trackler 2.2.1.177 → 2.2.1.178

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/go/config/exercise_readme.go.tmpl +3 -3
  4. data/tracks/go/docs/TESTS.md +1 -1
  5. data/tracks/go/exercises/accumulate/README.md +3 -3
  6. data/tracks/go/exercises/acronym/README.md +3 -3
  7. data/tracks/go/exercises/all-your-base/README.md +3 -3
  8. data/tracks/go/exercises/allergies/README.md +3 -3
  9. data/tracks/go/exercises/alphametics/README.md +3 -3
  10. data/tracks/go/exercises/anagram/README.md +3 -3
  11. data/tracks/go/exercises/armstrong-numbers/README.md +4 -4
  12. data/tracks/go/exercises/atbash-cipher/README.md +3 -3
  13. data/tracks/go/exercises/bank-account/README.md +3 -3
  14. data/tracks/go/exercises/beer-song/README.md +3 -3
  15. data/tracks/go/exercises/binary-search-tree/README.md +3 -3
  16. data/tracks/go/exercises/binary-search/README.md +3 -3
  17. data/tracks/go/exercises/binary/README.md +3 -3
  18. data/tracks/go/exercises/bob/README.md +3 -3
  19. data/tracks/go/exercises/book-store/README.md +3 -3
  20. data/tracks/go/exercises/bowling/README.md +3 -3
  21. data/tracks/go/exercises/bracket-push/README.md +3 -3
  22. data/tracks/go/exercises/change/README.md +3 -3
  23. data/tracks/go/exercises/circular-buffer/README.md +3 -3
  24. data/tracks/go/exercises/clock/README.md +3 -3
  25. data/tracks/go/exercises/collatz-conjecture/README.md +3 -3
  26. data/tracks/go/exercises/connect/README.md +3 -3
  27. data/tracks/go/exercises/counter/README.md +3 -3
  28. data/tracks/go/exercises/crypto-square/README.md +30 -27
  29. data/tracks/go/exercises/custom-set/README.md +3 -3
  30. data/tracks/go/exercises/diamond/README.md +3 -3
  31. data/tracks/go/exercises/difference-of-squares/README.md +3 -3
  32. data/tracks/go/exercises/diffie-hellman/README.md +3 -3
  33. data/tracks/go/exercises/dominoes/README.md +3 -3
  34. data/tracks/go/exercises/error-handling/README.md +3 -3
  35. data/tracks/go/exercises/etl/README.md +3 -3
  36. data/tracks/go/exercises/flatten-array/README.md +3 -3
  37. data/tracks/go/exercises/food-chain/README.md +3 -3
  38. data/tracks/go/exercises/forth/README.md +3 -3
  39. data/tracks/go/exercises/gigasecond/README.md +3 -3
  40. data/tracks/go/exercises/grade-school/README.md +3 -3
  41. data/tracks/go/exercises/grains/README.md +3 -3
  42. data/tracks/go/exercises/grep/README.md +3 -3
  43. data/tracks/go/exercises/hamming/README.md +7 -6
  44. data/tracks/go/exercises/hello-world/README.md +3 -3
  45. data/tracks/go/exercises/hello-world/hello_test.go +1 -1
  46. data/tracks/go/exercises/hexadecimal/README.md +3 -3
  47. data/tracks/go/exercises/house/README.md +3 -3
  48. data/tracks/go/exercises/isbn-verifier/README.md +3 -3
  49. data/tracks/go/exercises/isogram/README.md +3 -3
  50. data/tracks/go/exercises/kindergarten-garden/README.md +3 -3
  51. data/tracks/go/exercises/largest-series-product/README.md +3 -3
  52. data/tracks/go/exercises/leap/README.md +3 -3
  53. data/tracks/go/exercises/ledger/README.md +3 -3
  54. data/tracks/go/exercises/linked-list/README.md +20 -27
  55. data/tracks/go/exercises/luhn/README.md +3 -3
  56. data/tracks/go/exercises/markdown/README.md +3 -3
  57. data/tracks/go/exercises/matrix/README.md +3 -3
  58. data/tracks/go/exercises/meetup/README.md +3 -3
  59. data/tracks/go/exercises/minesweeper/README.md +3 -3
  60. data/tracks/go/exercises/nth-prime/README.md +3 -3
  61. data/tracks/go/exercises/nucleotide-count/README.md +3 -3
  62. data/tracks/go/exercises/ocr-numbers/README.md +3 -3
  63. data/tracks/go/exercises/octal/README.md +3 -3
  64. data/tracks/go/exercises/paasio/README.md +3 -3
  65. data/tracks/go/exercises/palindrome-products/README.md +3 -3
  66. data/tracks/go/exercises/pangram/README.md +3 -3
  67. data/tracks/go/exercises/parallel-letter-frequency/README.md +3 -3
  68. data/tracks/go/exercises/pascals-triangle/README.md +3 -3
  69. data/tracks/go/exercises/perfect-numbers/README.md +3 -3
  70. data/tracks/go/exercises/phone-number/README.md +3 -3
  71. data/tracks/go/exercises/pig-latin/README.md +3 -3
  72. data/tracks/go/exercises/poker/README.md +3 -3
  73. data/tracks/go/exercises/pov/README.md +3 -3
  74. data/tracks/go/exercises/prime-factors/README.md +3 -3
  75. data/tracks/go/exercises/protein-translation/README.md +3 -3
  76. data/tracks/go/exercises/proverb/README.md +3 -3
  77. data/tracks/go/exercises/pythagorean-triplet/README.md +3 -3
  78. data/tracks/go/exercises/queen-attack/README.md +3 -3
  79. data/tracks/go/exercises/rail-fence-cipher/README.md +3 -3
  80. data/tracks/go/exercises/raindrops/README.md +3 -3
  81. data/tracks/go/exercises/react/README.md +3 -3
  82. data/tracks/go/exercises/rectangles/README.md +3 -3
  83. data/tracks/go/exercises/reverse-string/README.md +3 -3
  84. data/tracks/go/exercises/rna-transcription/README.md +3 -3
  85. data/tracks/go/exercises/robot-name/README.md +3 -3
  86. data/tracks/go/exercises/robot-simulator/README.md +3 -3
  87. data/tracks/go/exercises/roman-numerals/README.md +3 -3
  88. data/tracks/go/exercises/rotational-cipher/README.md +3 -3
  89. data/tracks/go/exercises/run-length-encoding/README.md +3 -3
  90. data/tracks/go/exercises/saddle-points/README.md +3 -3
  91. data/tracks/go/exercises/say/README.md +4 -4
  92. data/tracks/go/exercises/scale-generator/README.md +12 -19
  93. data/tracks/go/exercises/scrabble-score/README.md +3 -3
  94. data/tracks/go/exercises/secret-handshake/README.md +3 -3
  95. data/tracks/go/exercises/series/README.md +9 -9
  96. data/tracks/go/exercises/sieve/README.md +8 -6
  97. data/tracks/go/exercises/simple-cipher/README.md +3 -3
  98. data/tracks/go/exercises/simple-linked-list/README.md +3 -3
  99. data/tracks/go/exercises/space-age/README.md +3 -3
  100. data/tracks/go/exercises/spiral-matrix/README.md +3 -3
  101. data/tracks/go/exercises/strain/README.md +3 -3
  102. data/tracks/go/exercises/sublist/README.md +3 -3
  103. data/tracks/go/exercises/sum-of-multiples/README.md +3 -3
  104. data/tracks/go/exercises/tournament/README.md +3 -3
  105. data/tracks/go/exercises/transpose/README.md +3 -3
  106. data/tracks/go/exercises/tree-building/README.md +3 -3
  107. data/tracks/go/exercises/triangle/README.md +3 -3
  108. data/tracks/go/exercises/triangle/triangle.go +2 -2
  109. data/tracks/go/exercises/trinary/README.md +3 -3
  110. data/tracks/go/exercises/twelve-days/README.md +3 -3
  111. data/tracks/go/exercises/two-bucket/README.md +3 -3
  112. data/tracks/go/exercises/two-fer/README.md +3 -3
  113. data/tracks/go/exercises/variable-length-quantity/README.md +3 -3
  114. data/tracks/go/exercises/word-count/README.md +3 -3
  115. data/tracks/go/exercises/word-search/README.md +3 -3
  116. data/tracks/go/exercises/wordy/README.md +3 -3
  117. data/tracks/go/exercises/yacht/README.md +9 -10
  118. data/tracks/go/exercises/zebra-puzzle/README.md +3 -3
  119. metadata +2 -2
@@ -11,10 +11,10 @@ unique elements.
11
11
 
12
12
  To run the tests run the command `go test` from within the exercise directory.
13
13
 
14
- If the test suite contains benchmarks, you can run these with the `-bench`
15
- flag:
14
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
15
+ flags:
16
16
 
17
- go test -bench .
17
+ go test -v --bench . --benchmem
18
18
 
19
19
  Keep in mind that each reviewer will run benchmarks on a different machine, with
20
20
  different specs, so the results from these benchmark tests may vary.
@@ -56,10 +56,10 @@ E·······E
56
56
 
57
57
  To run the tests run the command `go test` from within the exercise directory.
58
58
 
59
- If the test suite contains benchmarks, you can run these with the `-bench`
60
- flag:
59
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
60
+ flags:
61
61
 
62
- go test -bench .
62
+ go test -v --bench . --benchmem
63
63
 
64
64
  Keep in mind that each reviewer will run benchmarks on a different machine, with
65
65
  different specs, so the results from these benchmark tests may vary.
@@ -16,10 +16,10 @@ natural numbers is 3025 - 385 = 2640.
16
16
 
17
17
  To run the tests run the command `go test` from within the exercise directory.
18
18
 
19
- If the test suite contains benchmarks, you can run these with the `-bench`
20
- flag:
19
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
20
+ flags:
21
21
 
22
- go test -bench .
22
+ go test -v --bench . --benchmem
23
23
 
24
24
  Keep in mind that each reviewer will run benchmarks on a different machine, with
25
25
  different specs, so the results from these benchmark tests may vary.
@@ -41,10 +41,10 @@ secret s.
41
41
 
42
42
  To run the tests run the command `go test` from within the exercise directory.
43
43
 
44
- If the test suite contains benchmarks, you can run these with the `-bench`
45
- flag:
44
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
45
+ flags:
46
46
 
47
- go test -bench .
47
+ go test -v --bench . --benchmem
48
48
 
49
49
  Keep in mind that each reviewer will run benchmarks on a different machine, with
50
50
  different specs, so the results from these benchmark tests may vary.
@@ -49,10 +49,10 @@ when ok is true, the test program will check the chain for validity only.
49
49
 
50
50
  To run the tests run the command `go test` from within the exercise directory.
51
51
 
52
- If the test suite contains benchmarks, you can run these with the `-bench`
53
- flag:
52
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
53
+ flags:
54
54
 
55
- go test -bench .
55
+ go test -v --bench . --benchmem
56
56
 
57
57
  Keep in mind that each reviewer will run benchmarks on a different machine, with
58
58
  different specs, so the results from these benchmark tests may vary.
@@ -51,10 +51,10 @@ helpful way to return error information from panic recovery.
51
51
 
52
52
  To run the tests run the command `go test` from within the exercise directory.
53
53
 
54
- If the test suite contains benchmarks, you can run these with the `-bench`
55
- flag:
54
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
55
+ flags:
56
56
 
57
- go test -bench .
57
+ go test -v --bench . --benchmem
58
58
 
59
59
  Keep in mind that each reviewer will run benchmarks on a different machine, with
60
60
  different specs, so the results from these benchmark tests may vary.
@@ -50,10 +50,10 @@ game while being scored at 4 in the Hawaiian-language version.
50
50
 
51
51
  To run the tests run the command `go test` from within the exercise directory.
52
52
 
53
- If the test suite contains benchmarks, you can run these with the `-bench`
54
- flag:
53
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
54
+ flags:
55
55
 
56
- go test -bench .
56
+ go test -v --bench . --benchmem
57
57
 
58
58
  Keep in mind that each reviewer will run benchmarks on a different machine, with
59
59
  different specs, so the results from these benchmark tests may vary.
@@ -14,10 +14,10 @@ output: [1,2,3,4,5]
14
14
 
15
15
  To run the tests run the command `go test` from within the exercise directory.
16
16
 
17
- If the test suite contains benchmarks, you can run these with the `-bench`
18
- flag:
17
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
18
+ flags:
19
19
 
20
- go test -bench .
20
+ go test -v --bench . --benchmem
21
21
 
22
22
  Keep in mind that each reviewer will run benchmarks on a different machine, with
23
23
  different specs, so the results from these benchmark tests may vary.
@@ -67,10 +67,10 @@ She's dead, of course!
67
67
 
68
68
  To run the tests run the command `go test` from within the exercise directory.
69
69
 
70
- If the test suite contains benchmarks, you can run these with the `-bench`
71
- flag:
70
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
71
+ flags:
72
72
 
73
- go test -bench .
73
+ go test -v --bench . --benchmem
74
74
 
75
75
  Keep in mind that each reviewer will run benchmarks on a different machine, with
76
76
  different specs, so the results from these benchmark tests may vary.
@@ -29,10 +29,10 @@ Words are case-insensitive.
29
29
 
30
30
  To run the tests run the command `go test` from within the exercise directory.
31
31
 
32
- If the test suite contains benchmarks, you can run these with the `-bench`
33
- flag:
32
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
33
+ flags:
34
34
 
35
- go test -bench .
35
+ go test -v --bench . --benchmem
36
36
 
37
37
  Keep in mind that each reviewer will run benchmarks on a different machine, with
38
38
  different specs, so the results from these benchmark tests may vary.
@@ -8,10 +8,10 @@ A gigasecond is 10^9 (1,000,000,000) seconds.
8
8
 
9
9
  To run the tests run the command `go test` from within the exercise directory.
10
10
 
11
- If the test suite contains benchmarks, you can run these with the `-bench`
12
- flag:
11
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
12
+ flags:
13
13
 
14
- go test -bench .
14
+ go test -v --bench . --benchmem
15
15
 
16
16
  Keep in mind that each reviewer will run benchmarks on a different machine, with
17
17
  different specs, so the results from these benchmark tests may vary.
@@ -38,10 +38,10 @@ experiment make the code better? Worse? Did you learn anything from it?
38
38
 
39
39
  To run the tests run the command `go test` from within the exercise directory.
40
40
 
41
- If the test suite contains benchmarks, you can run these with the `-bench`
42
- flag:
41
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
42
+ flags:
43
43
 
44
- go test -bench .
44
+ go test -v --bench . --benchmem
45
45
 
46
46
  Keep in mind that each reviewer will run benchmarks on a different machine, with
47
47
  different specs, so the results from these benchmark tests may vary.
@@ -30,10 +30,10 @@ experiment make the code better? Worse? Did you learn anything from it?
30
30
 
31
31
  To run the tests run the command `go test` from within the exercise directory.
32
32
 
33
- If the test suite contains benchmarks, you can run these with the `-bench`
34
- flag:
33
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
34
+ flags:
35
35
 
36
- go test -bench .
36
+ go test -v --bench . --benchmem
37
37
 
38
38
  Keep in mind that each reviewer will run benchmarks on a different machine, with
39
39
  different specs, so the results from these benchmark tests may vary.
@@ -83,10 +83,10 @@ func Search(pattern string, flags, files []string) []string {
83
83
 
84
84
  To run the tests run the command `go test` from within the exercise directory.
85
85
 
86
- If the test suite contains benchmarks, you can run these with the `-bench`
87
- flag:
86
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
87
+ flags:
88
88
 
89
- go test -bench .
89
+ go test -v --bench . --benchmem
90
90
 
91
91
  Keep in mind that each reviewer will run benchmarks on a different machine, with
92
92
  different specs, so the results from these benchmark tests may vary.
@@ -31,9 +31,10 @@ The Hamming distance between these two DNA strands is 7.
31
31
 
32
32
  # Implementation notes
33
33
 
34
- The Hamming distance is only defined for sequences of equal length. This means
35
- that based on the definition, each language could deal with getting sequences
36
- of equal length differently.
34
+ The Hamming distance is only defined for sequences of equal length, so
35
+ an attempt to calculate it between sequences of different lengths should
36
+ not work. The general handling of this situation (e.g., raising an
37
+ exception vs returning a special value) may differ between languages.
37
38
 
38
39
  You may be wondering about the `cases_test.go` file. We explain it in the
39
40
  [leap exercise][leap-exercise-readme].
@@ -45,10 +46,10 @@ You may be wondering about the `cases_test.go` file. We explain it in the
45
46
 
46
47
  To run the tests run the command `go test` from within the exercise directory.
47
48
 
48
- If the test suite contains benchmarks, you can run these with the `-bench`
49
- flag:
49
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
50
+ flags:
50
51
 
51
- go test -bench .
52
+ go test -v --bench . --benchmem
52
53
 
53
54
  Keep in mind that each reviewer will run benchmarks on a different machine, with
54
55
  different specs, so the results from these benchmark tests may vary.
@@ -18,10 +18,10 @@ If everything goes well, you will be ready to fetch your first real exercise.
18
18
 
19
19
  To run the tests run the command `go test` from within the exercise directory.
20
20
 
21
- If the test suite contains benchmarks, you can run these with the `-bench`
22
- flag:
21
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
22
+ flags:
23
23
 
24
- go test -bench .
24
+ go test -v --bench . --benchmem
25
25
 
26
26
  Keep in mind that each reviewer will run benchmarks on a different machine, with
27
27
  different specs, so the results from these benchmark tests may vary.
@@ -18,7 +18,7 @@ func TestHelloWorld(t *testing.T) {
18
18
  // form `func BenchmarkXxx(*testing.B)` and can be used to test the performance
19
19
  // of your implementation. They may not be present in every exercise, but when
20
20
  // they are you can run them by including the `-bench` flag with the `go test`
21
- // command, like so: `go test -bench .`
21
+ // command, like so: `go test -v --bench . --benchmem`
22
22
  //
23
23
  // You will see output similar to the following:
24
24
  //
@@ -11,10 +11,10 @@ The program should handle invalid hexadecimal strings.
11
11
 
12
12
  To run the tests run the command `go test` from within the exercise directory.
13
13
 
14
- If the test suite contains benchmarks, you can run these with the `-bench`
15
- flag:
14
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
15
+ flags:
16
16
 
17
- go test -bench .
17
+ go test -v --bench . --benchmem
18
18
 
19
19
  Keep in mind that each reviewer will run benchmarks on a different machine, with
20
20
  different specs, so the results from these benchmark tests may vary.
@@ -109,10 +109,10 @@ that lay in the house that Jack built.
109
109
 
110
110
  To run the tests run the command `go test` from within the exercise directory.
111
111
 
112
- If the test suite contains benchmarks, you can run these with the `-bench`
113
- flag:
112
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
113
+ flags:
114
114
 
115
- go test -bench .
115
+ go test -v --bench . --benchmem
116
116
 
117
117
  Keep in mind that each reviewer will run benchmarks on a different machine, with
118
118
  different specs, so the results from these benchmark tests may vary.
@@ -44,10 +44,10 @@ Now, it's even trickier since the check digit of an ISBN-10 may be 'X' (represen
44
44
 
45
45
  To run the tests run the command `go test` from within the exercise directory.
46
46
 
47
- If the test suite contains benchmarks, you can run these with the `-bench`
48
- flag:
47
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
48
+ flags:
49
49
 
50
- go test -bench .
50
+ go test -v --bench . --benchmem
51
51
 
52
52
  Keep in mind that each reviewer will run benchmarks on a different machine, with
53
53
  different specs, so the results from these benchmark tests may vary.
@@ -17,10 +17,10 @@ The word *isograms*, however, is not an isogram, because the s repeats.
17
17
 
18
18
  To run the tests run the command `go test` from within the exercise directory.
19
19
 
20
- If the test suite contains benchmarks, you can run these with the `-bench`
21
- flag:
20
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
21
+ flags:
22
22
 
23
- go test -bench .
23
+ go test -v --bench . --benchmem
24
24
 
25
25
  Keep in mind that each reviewer will run benchmarks on a different machine, with
26
26
  different specs, so the results from these benchmark tests may vary.
@@ -63,10 +63,10 @@ While asking for Bob's plants would yield:
63
63
 
64
64
  To run the tests run the command `go test` from within the exercise directory.
65
65
 
66
- If the test suite contains benchmarks, you can run these with the `-bench`
67
- flag:
66
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
67
+ flags:
68
68
 
69
- go test -bench .
69
+ go test -v --bench . --benchmem
70
70
 
71
71
  Keep in mind that each reviewer will run benchmarks on a different machine, with
72
72
  different specs, so the results from these benchmark tests may vary.
@@ -17,10 +17,10 @@ the largest product for a series of 6 digits is 23520.
17
17
 
18
18
  To run the tests run the command `go test` from within the exercise directory.
19
19
 
20
- If the test suite contains benchmarks, you can run these with the `-bench`
21
- flag:
20
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
21
+ flags:
22
22
 
23
- go test -bench .
23
+ go test -v --bench . --benchmem
24
24
 
25
25
  Keep in mind that each reviewer will run benchmarks on a different machine, with
26
26
  different specs, so the results from these benchmark tests may vary.
@@ -46,10 +46,10 @@ file. The Go specific transformation of that data lives in the `cases_test.go` f
46
46
 
47
47
  To run the tests run the command `go test` from within the exercise directory.
48
48
 
49
- If the test suite contains benchmarks, you can run these with the `-bench`
50
- flag:
49
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
50
+ flags:
51
51
 
52
- go test -bench .
52
+ go test -v --bench . --benchmem
53
53
 
54
54
  Keep in mind that each reviewer will run benchmarks on a different machine, with
55
55
  different specs, so the results from these benchmark tests may vary.
@@ -18,10 +18,10 @@ containing that log, this will help reviewers.
18
18
 
19
19
  To run the tests run the command `go test` from within the exercise directory.
20
20
 
21
- If the test suite contains benchmarks, you can run these with the `-bench`
22
- flag:
21
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
22
+ flags:
23
23
 
24
- go test -bench .
24
+ go test -v --bench . --benchmem
25
25
 
26
26
  Keep in mind that each reviewer will run benchmarks on a different machine, with
27
27
  different specs, so the results from these benchmark tests may vary.
@@ -1,4 +1,5 @@
1
1
  # Linked List
2
+
2
3
  Implement a doubly linked list.
3
4
 
4
5
  Like an array, a linked list is a simple linear data structure. Several
@@ -11,49 +12,41 @@ In a *doubly linked list* each node also holds a link to the previous
11
12
  node.
12
13
 
13
14
  You will write an implementation of a doubly linked list. Implement a
14
- `Node` to hold a value and pointers to the next and previous nodes. Then
15
- implement a `List` which holds references to the first and last node and
16
- offers functions for adding and removing items.
17
-
18
- Your `Node` should have the following fields and functions:
19
-
20
- * `Val`: the node's value (we will use `interface{}`).
21
- * `Next()`: pointer to the next node.
22
- * `Prev()`: pointer to the previous node.
23
- * `First()`: pointer to the first node (head).
24
- * `Last()`: pointer to the last node (tail).
25
-
26
- Your `List` should have the following fields and functions:
15
+ Node to hold a value and pointers to the next and previous nodes. Then
16
+ implement a List which holds references to the first and last node and
17
+ offers an array-like interface for adding and removing items:
27
18
 
28
- * `First()`: pointer to the first node (head).
29
- * `Last()`: pointer to the last node (tail).
30
- * `PushBack(v interface{})`: insert value at back.
31
- * `PopBack() (interface{}, error)`: remove value at back.
32
- * `PushFront(v interface{}) `: remove value at front.
33
- * `PopFront() (interface{}, error)`: insert value at front.
34
- * `Reverse()`: reverse the linked list.
19
+ * `push` (*insert value at back*);
20
+ * `pop` (*remove value at back*);
21
+ * `shift` (*remove value at front*).
22
+ * `unshift` (*insert value at front*);
35
23
 
36
- Instead of not covering error conditions, like calling `PopBack` or `PopFront` on an empty list,
37
- we will follow Go's idiomatic style and implement the error checks as well.
24
+ To keep your implementation simple, the tests will not cover error
25
+ conditions. Specifically: `pop` or `shift` will never be called on an
26
+ empty list.
38
27
 
39
28
  If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list).
40
29
 
41
30
  ## Running the tests
31
+
42
32
  To run the tests run the command `go test` from within the exercise directory.
43
33
 
44
- If the test suite contains benchmarks, you can run these with the `-bench`
45
- flag:
34
+ If the test suite contains benchmarks, you can run these with the `--bench` and `--benchmem`
35
+ flags:
46
36
 
47
- go test -bench .
37
+ go test -v --bench . --benchmem
48
38
 
49
39
  Keep in mind that each reviewer will run benchmarks on a different machine, with
50
40
  different specs, so the results from these benchmark tests may vary.
51
41
 
52
42
  ## Further information
53
- If you are not familar with linked list, try [this tutorial](https://visualgo.net/en/list).
43
+
44
+ For more detailed information about the Go track, including how to get help if
45
+ you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
54
46
 
55
47
  ## Source
56
- Classic CS data structure.
48
+
49
+ Classic computer science topic
57
50
 
58
51
  ## Submitting Incomplete Solutions
59
52
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.