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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/go/config/exercise_readme.go.tmpl +3 -3
- data/tracks/go/docs/TESTS.md +1 -1
- data/tracks/go/exercises/accumulate/README.md +3 -3
- data/tracks/go/exercises/acronym/README.md +3 -3
- data/tracks/go/exercises/all-your-base/README.md +3 -3
- data/tracks/go/exercises/allergies/README.md +3 -3
- data/tracks/go/exercises/alphametics/README.md +3 -3
- data/tracks/go/exercises/anagram/README.md +3 -3
- data/tracks/go/exercises/armstrong-numbers/README.md +4 -4
- data/tracks/go/exercises/atbash-cipher/README.md +3 -3
- data/tracks/go/exercises/bank-account/README.md +3 -3
- data/tracks/go/exercises/beer-song/README.md +3 -3
- data/tracks/go/exercises/binary-search-tree/README.md +3 -3
- data/tracks/go/exercises/binary-search/README.md +3 -3
- data/tracks/go/exercises/binary/README.md +3 -3
- data/tracks/go/exercises/bob/README.md +3 -3
- data/tracks/go/exercises/book-store/README.md +3 -3
- data/tracks/go/exercises/bowling/README.md +3 -3
- data/tracks/go/exercises/bracket-push/README.md +3 -3
- data/tracks/go/exercises/change/README.md +3 -3
- data/tracks/go/exercises/circular-buffer/README.md +3 -3
- data/tracks/go/exercises/clock/README.md +3 -3
- data/tracks/go/exercises/collatz-conjecture/README.md +3 -3
- data/tracks/go/exercises/connect/README.md +3 -3
- data/tracks/go/exercises/counter/README.md +3 -3
- data/tracks/go/exercises/crypto-square/README.md +30 -27
- data/tracks/go/exercises/custom-set/README.md +3 -3
- data/tracks/go/exercises/diamond/README.md +3 -3
- data/tracks/go/exercises/difference-of-squares/README.md +3 -3
- data/tracks/go/exercises/diffie-hellman/README.md +3 -3
- data/tracks/go/exercises/dominoes/README.md +3 -3
- data/tracks/go/exercises/error-handling/README.md +3 -3
- data/tracks/go/exercises/etl/README.md +3 -3
- data/tracks/go/exercises/flatten-array/README.md +3 -3
- data/tracks/go/exercises/food-chain/README.md +3 -3
- data/tracks/go/exercises/forth/README.md +3 -3
- data/tracks/go/exercises/gigasecond/README.md +3 -3
- data/tracks/go/exercises/grade-school/README.md +3 -3
- data/tracks/go/exercises/grains/README.md +3 -3
- data/tracks/go/exercises/grep/README.md +3 -3
- data/tracks/go/exercises/hamming/README.md +7 -6
- data/tracks/go/exercises/hello-world/README.md +3 -3
- data/tracks/go/exercises/hello-world/hello_test.go +1 -1
- data/tracks/go/exercises/hexadecimal/README.md +3 -3
- data/tracks/go/exercises/house/README.md +3 -3
- data/tracks/go/exercises/isbn-verifier/README.md +3 -3
- data/tracks/go/exercises/isogram/README.md +3 -3
- data/tracks/go/exercises/kindergarten-garden/README.md +3 -3
- data/tracks/go/exercises/largest-series-product/README.md +3 -3
- data/tracks/go/exercises/leap/README.md +3 -3
- data/tracks/go/exercises/ledger/README.md +3 -3
- data/tracks/go/exercises/linked-list/README.md +20 -27
- data/tracks/go/exercises/luhn/README.md +3 -3
- data/tracks/go/exercises/markdown/README.md +3 -3
- data/tracks/go/exercises/matrix/README.md +3 -3
- data/tracks/go/exercises/meetup/README.md +3 -3
- data/tracks/go/exercises/minesweeper/README.md +3 -3
- data/tracks/go/exercises/nth-prime/README.md +3 -3
- data/tracks/go/exercises/nucleotide-count/README.md +3 -3
- data/tracks/go/exercises/ocr-numbers/README.md +3 -3
- data/tracks/go/exercises/octal/README.md +3 -3
- data/tracks/go/exercises/paasio/README.md +3 -3
- data/tracks/go/exercises/palindrome-products/README.md +3 -3
- data/tracks/go/exercises/pangram/README.md +3 -3
- data/tracks/go/exercises/parallel-letter-frequency/README.md +3 -3
- data/tracks/go/exercises/pascals-triangle/README.md +3 -3
- data/tracks/go/exercises/perfect-numbers/README.md +3 -3
- data/tracks/go/exercises/phone-number/README.md +3 -3
- data/tracks/go/exercises/pig-latin/README.md +3 -3
- data/tracks/go/exercises/poker/README.md +3 -3
- data/tracks/go/exercises/pov/README.md +3 -3
- data/tracks/go/exercises/prime-factors/README.md +3 -3
- data/tracks/go/exercises/protein-translation/README.md +3 -3
- data/tracks/go/exercises/proverb/README.md +3 -3
- data/tracks/go/exercises/pythagorean-triplet/README.md +3 -3
- data/tracks/go/exercises/queen-attack/README.md +3 -3
- data/tracks/go/exercises/rail-fence-cipher/README.md +3 -3
- data/tracks/go/exercises/raindrops/README.md +3 -3
- data/tracks/go/exercises/react/README.md +3 -3
- data/tracks/go/exercises/rectangles/README.md +3 -3
- data/tracks/go/exercises/reverse-string/README.md +3 -3
- data/tracks/go/exercises/rna-transcription/README.md +3 -3
- data/tracks/go/exercises/robot-name/README.md +3 -3
- data/tracks/go/exercises/robot-simulator/README.md +3 -3
- data/tracks/go/exercises/roman-numerals/README.md +3 -3
- data/tracks/go/exercises/rotational-cipher/README.md +3 -3
- data/tracks/go/exercises/run-length-encoding/README.md +3 -3
- data/tracks/go/exercises/saddle-points/README.md +3 -3
- data/tracks/go/exercises/say/README.md +4 -4
- data/tracks/go/exercises/scale-generator/README.md +12 -19
- data/tracks/go/exercises/scrabble-score/README.md +3 -3
- data/tracks/go/exercises/secret-handshake/README.md +3 -3
- data/tracks/go/exercises/series/README.md +9 -9
- data/tracks/go/exercises/sieve/README.md +8 -6
- data/tracks/go/exercises/simple-cipher/README.md +3 -3
- data/tracks/go/exercises/simple-linked-list/README.md +3 -3
- data/tracks/go/exercises/space-age/README.md +3 -3
- data/tracks/go/exercises/spiral-matrix/README.md +3 -3
- data/tracks/go/exercises/strain/README.md +3 -3
- data/tracks/go/exercises/sublist/README.md +3 -3
- data/tracks/go/exercises/sum-of-multiples/README.md +3 -3
- data/tracks/go/exercises/tournament/README.md +3 -3
- data/tracks/go/exercises/transpose/README.md +3 -3
- data/tracks/go/exercises/tree-building/README.md +3 -3
- data/tracks/go/exercises/triangle/README.md +3 -3
- data/tracks/go/exercises/triangle/triangle.go +2 -2
- data/tracks/go/exercises/trinary/README.md +3 -3
- data/tracks/go/exercises/twelve-days/README.md +3 -3
- data/tracks/go/exercises/two-bucket/README.md +3 -3
- data/tracks/go/exercises/two-fer/README.md +3 -3
- data/tracks/go/exercises/variable-length-quantity/README.md +3 -3
- data/tracks/go/exercises/word-count/README.md +3 -3
- data/tracks/go/exercises/word-search/README.md +3 -3
- data/tracks/go/exercises/wordy/README.md +3 -3
- data/tracks/go/exercises/yacht/README.md +9 -10
- data/tracks/go/exercises/zebra-puzzle/README.md +3 -3
- 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
|
15
|
-
|
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
|
60
|
-
|
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
|
20
|
-
|
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
|
45
|
-
|
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
|
53
|
-
|
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
|
55
|
-
|
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
|
54
|
-
|
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
|
18
|
-
|
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
|
71
|
-
|
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
|
33
|
-
|
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
|
12
|
-
|
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
|
42
|
-
|
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
|
34
|
-
|
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
|
87
|
-
|
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
|
35
|
-
|
36
|
-
of
|
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
|
49
|
-
|
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
|
22
|
-
|
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
|
15
|
-
|
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
|
113
|
-
|
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
|
48
|
-
|
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
|
21
|
-
|
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
|
67
|
-
|
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
|
21
|
-
|
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
|
50
|
-
|
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
|
22
|
-
|
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
|
-
|
15
|
-
implement a
|
16
|
-
offers
|
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
|
-
* `
|
29
|
-
* `
|
30
|
-
* `
|
31
|
-
* `
|
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
|
-
|
37
|
-
|
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
|
45
|
-
|
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
|
-
|
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
|
-
|
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.
|