@@ -9,31 +9,228 @@ are uninteresting/improbable in the context of Haskell.
99A number of problems were added to fill out 99 problems.
1010- These are the problems 29, 30, 42, 43, 44, 45, 51, 52, 53, 74, 75, 76, 77, 78, and 79.
1111
12- ## The problems
12+ ## Working with lists
1313
14- * Questions 1 to 10: [ Lists ] ( src/Lists .hs )
14+ [ P01 ] ( src/List/P01 .hs ) ( * ) Find the last element of a list.
1515
16- * Questions 11 to 20: [ Lists, continued ] ( src/Lists2 .hs )
16+ [ P02 ] ( src/List/P02 .hs ) ( * ) Find the last but one element of a list.
1717
18- * Questions 21 to 30: [ Lists again ] ( src/Lists3 .hs )
18+ [ P03 ] ( src/List/P03 .hs ) ( * ) Find the Kth element of a list.
1919
20- * Questions 31 to 45: [ Arithmetic ] ( src/Arithmetic .hs )
20+ [ P04 ] ( src/List/P04 .hs ) ( * ) Find the number of elements of a list.
2121
22- * Questions 46 to 53: [ Logic and codes ] ( src/Logic .hs )
22+ [ P05 ] ( src/List/P05 .hs ) ( * ) Reverse a list.
2323
24- * Questions 54A to 60: [ Binary trees ] ( src/BinaryTrees .hs )
24+ [ P06 ] ( src/List/P06 .hs ) ( * ) Find out whether a list is a palindrome.
2525
26- * Questions 61 to 69: [ Binary trees, continued ] ( src/BinaryTrees2 .hs )
26+ [ P07 ] ( src/List/P07 .hs ) ( ** ) Flatten a nested list structure.
2727
28- * Questions 70B to 73: [ Multiway trees ] ( src/MultiwayTrees .hs )
28+ [ P08 ] ( src/List/P08 .hs ) ( ** ) Eliminate consecutive duplicates of list elements.
2929
30- * Questions 74 to 79: [ Monads ] ( src/Monads .hs )
30+ [ P09 ] ( src/List/P09 .hs ) ( ** ) Pack consecutive duplicates of list elements into sublists.
3131
32- * Questions 80 to 89: [ Graphs ] ( src/Graphs .hs )
32+ [ P10 ] ( src/List/P10 .hs ) ( * ) Run-length encoding of a list.
3333
34- * Questions 90 to 94: [ Miscellaneous problems ] ( src/Misc .hs )
34+ [ P11 ] ( src/List/P11 .hs ) ( * ) Modified run-length encoding.
3535
36- * Questions 95 to 99: [ Miscellaneous problems, continued] ( src/Misc2.hs )
36+ [ P12] ( src/List/P12.hs ) (** ) Decode a run-length encoded list.
37+
38+ [ P13] ( src/List/P13.hs ) (** ) Run-length encoding of a list (direct solution).
39+
40+ [ P14] ( src/List/P14.hs ) (* ) Duplicate the elements of a list.
41+
42+ [ P15] ( src/List/P15.hs ) (** ) Duplicate the elements of a list a given number of times.
43+
44+ [ P16] ( src/List/P16.hs ) (** ) Drop every Nth element from a list.
45+
46+ [ P17] ( src/List/P17.hs ) (* ) Split a list into two parts.
47+
48+ [ P18] ( src/List/P18.hs ) (** ) Extract a slice from a list.
49+
50+ [ P19] ( src/List/P19.hs ) (** ) Rotate a list N places to the left.
51+
52+ [ P20] ( src/List/P20.hs ) (* ) Remove the Kth element from a list.
53+
54+ [ P21] ( src/List/P21.hs ) (* ) Insert an element at a given position into a list.
55+
56+ [ P22] ( src/List/P22.hs ) (* ) Create a list containing all integers within a given range.
57+
58+ [ P23] ( src/List/P23.hs ) (** ) Extract a given number of randomly selected elements from a list.
59+
60+ [ P24] ( src/List/P24.hs ) (* ) Lotto: Draw N different random numbers from the set 1..M.
61+
62+ [ P25] ( src/List/P25.hs ) (* ) Generate a random permutation of the elements of a list.
63+
64+ [ P26] ( src/List/P26.hs ) (** ) Generate the combinations of K distinct objects chosen from the N elements of a list.
65+
66+ [ P27] ( src/List/P27.hs ) (** ) Group the elements of a set into disjoint subsets.
67+
68+ [ P28] ( src/List/P28.hs ) (** ) Sorting a list of lists according to length of sublists.
69+
70+ [ P29] ( src/List/P28.hs ) (* ) Write a function to compute the nth Fibonacci number.
71+
72+ [ P30] ( src/List/P30.hs ) (** ) Write a function to compute the nth Fibonacci number.
73+
74+ ## Arithmetic
75+
76+ [ P31] ( src/Arithmetic/P31.hs ) (** ) Determine whether a given integer number is prime.
77+
78+ [ P32] ( src/Arithmetic/P32.hs ) (** ) Determine the greatest common divisor of two positive integer numbers.
79+
80+ [ P33] ( src/Arithmetic/P33.hs ) (* ) Determine whether two positive integer numbers are coprime.
81+
82+ [ P34] ( src/Arithmetic/P34.hs ) (** ) Calculate Euler’s totient function ϕ(m).
83+
84+ [ P35] ( src/Arithmetic/P35.hs ) (** ) Determine the prime factors of a given positive integer.
85+
86+ [ P36] ( src/Arithmetic/P36.hs ) (** ) Determine the prime factors of a given positive integer (2).
87+
88+ [ P37] ( src/Arithmetic/P37.hs ) (** ) Calculate Euler’s totient function ϕ(m) (improved).
89+
90+ [ P38] ( src/Arithmetic/P38.hs ) (* ) Compare the two methods of calculating Euler’s totient function.
91+
92+ [ P39] ( src/Arithmetic/P39.hs ) (* ) A list of prime numbers.
93+
94+ [ P40] ( src/Arithmetic/P40.hs ) (** ) Goldbach's conjecture.
95+
96+ [ P41] ( src/Arithmetic/P41.hs ) (** ) A list of Goldbach compositions.
97+
98+ [ P42] ( src/Arithmetic/P42.hs ) (** ) Modular multiplicative inverse.
99+
100+ [ P43] ( src/Arithmetic/P43.hs ) (* ) Gaussian integer divisibility.
101+
102+ [ P44] ( src/Arithmetic/P44.hs ) (** ) Gaussian primes.
103+
104+ [ P45] ( src/Arithmetic/P45.hs ) (* ) Gaussian primes using the two-square theorem.
105+
106+ ## Logic and Codes
107+
108+ [ P46] ( src/Logic/P46.hs ) (** ) Truth tables for logical expressions.
109+
110+ [ P47] ( src/Logic/P47.hs ) (* ) Truth tables for logical expressions (2).
111+
112+ [ P48] ( src/Logic/P48.hs ) (** ) Truth tables for logical expressions (3).
113+
114+ [ P49] ( src/Logic/P49.hs ) (** ) Gray code.
115+
116+ [ P50] ( src/Logic/P50.hs ) (*** ) Huffman code.
117+
118+ [ P51] ( src/Logic/P51.hs ) (* ) Error correction codes.
119+
120+ [ P52] ( src/Logic/P52.hs ) (*** ) Conjunctive normal form.
121+
122+ [ P53] ( src/Logic/P53.hs ) (*** ) Resolution rule.
123+
124+ ## Binary Trees
125+
126+ P54A omitted; our tree representation will only allow well-formed trees.
127+
128+ [ P55] ( src/BinaryTree/P55.hs ) (** ) Construct completely balanced binary trees.
129+
130+ [ P56] ( src/BinaryTree/P56.hs ) (** ) Symmetric binary trees.
131+
132+ [ P57] ( src/BinaryTree/P57.hs ) (** ) Binary search trees (dictionaries).
133+
134+ [ P58] ( src/BinaryTree/P58.hs ) (** ) Generate-and-test paradigm.
135+
136+ [ P59] ( src/BinaryTree/P59.hs ) (** ) Construct height-balanced binary trees.
137+
138+ [ P60] ( src/BinaryTree/P60.hs ) (** ) Construct height-balanced binary trees with a given number of nodes.
139+
140+ [ P61] ( src/BinaryTree/P61.hs ) (* ) Count the leaves of a binary tree.
141+
142+ [ P61A] ( src/BinaryTree/P61a.hs ) (* ) Collect the leaves of a binary tree in a list.
143+
144+ [ P62] ( src/BinaryTree/P62.hs ) (* ) Collect the internal nodes of a binary tree in a list.
145+
146+ [ P62B] ( src/BinaryTree/P62b.hs ) (* ) Collect the nodes at a given level in a list.
147+
148+ [ P63] ( src/BinaryTree/P63.hs ) (** ) Construct a complete binary tree.
149+
150+ [ P64] ( src/BinaryTree/P64.hs ) (** ) Layout a binary tree (1).
151+
152+ [ P65] ( src/BinaryTree/P65.hs ) (** ) Layout a binary tree (2).
153+
154+ [ P66] ( src/BinaryTree/P66.hs ) (*** ) Layout a binary tree (3).
155+
156+ [ P67A] ( src/BinaryTree/P67a.hs ) (** ) A string representation of binary trees.
157+
158+ [ P68] ( src/BinaryTree/P68.hs ) (** ) Preorder and inorder sequences of binary trees.
159+
160+ [ P69] ( src/BinaryTree/P69.hs ) (** ) Dotstring representation of binary trees.
161+
162+ ## Multiway Trees
163+
164+ P70B omitted; we can only create well-formed trees.
165+
166+ [ P70C] ( src/MultiwayTree/P70c.hs ) (* ) Count the nodes of a multiway tree.
167+
168+ [ P70] ( src/MultiwayTree/P70.hs ) (** ) Tree construction from a node string.
169+
170+ [ P71] ( src/MultiwayTree/P71.hs ) (* ) Determine the internal path length of a tree.
171+
172+ [ P72] ( src/MultiwayTree/P72.hs ) (* ) Construct the postorder sequence of the tree nodes.
173+
174+ [ P73] ( src/MultiwayTree/P73.hs ) (** ) Lisp-like tree representation.
175+
176+
177+ ## Monads
178+
179+ [ P74] ( src/Monad/P74.hs ) (** ) Monads without do notation.
180+
181+ [ P75] ( src/Monad/P75.hs ) (* ) Maybe monad.
182+
183+ [ P76] ( src/Monad/P76.hs ) (* ) Either monad.
184+
185+ [ P77] ( src/Monad/P77.hs ) (* ) List monad.
186+
187+ [ P78] ( src/Monad/P78.hs ) (* ) Collatz conjecture.
188+
189+ [ P79] ( src/Monad/P79.hs ) (** ) Postfix notation.
190+
191+ ## Graphs
192+
193+ [ P80] ( src/Graph/P80.hs ) (*** ) Conversions.
194+
195+ [ P81] ( src/Graph/P81.hs ) (** ) Path from one node to another one.
196+
197+ [ P82] ( src/Graph/P82.hs ) (* ) Cycle from a given node.
198+
199+ [ P83] ( src/Graph/P83.hs ) (** ) Construct all spanning trees.
200+
201+ [ P84] ( src/Graph/P84.hs ) (** ) Construct the minimal spanning tree.
202+
203+ [ P85] ( src/Graph/P85.hs ) (** ) Graph isomorphism.
204+
205+ [ P86] ( src/Graph/P86.hs ) (** ) Node degree and graph coloration.
206+
207+ [ P87] ( src/Graph/P87.hs ) (** ) Depth-first order graph traversal.
208+
209+ [ P88] ( src/Graph/P88.hs ) (** ) Connected components.
210+
211+ [ P89] ( src/Graph/P89.hs ) (** ) Bipartite graphs.
212+
213+ ## Miscellaneous Problems
214+
215+ [ P90] ( src/Misc/P90.hs ) (** ) Eight queens problem.
216+
217+ [ P91] ( src/Misc/P91.hs ) (** ) Knight’s tour.
218+
219+ [ P92] ( src/Misc/P92.hs ) (*** ) Von Koch’s conjecture.
220+
221+ [ P93] ( src/Misc/P93.hs ) (*** ) An arithmetic puzzle.
222+
223+ [ P94] ( src/Misc/P94.hs ) (*** ) Generate K-regular simple graphs with N nodes.
224+
225+ [ P95] ( src/Misc/P95.hs ) (** ) English number words.
226+
227+ [ P96] ( src/Misc/P96.hs ) (** ) Syntax checker.
228+
229+ [ P97] ( src/Misc/P97.hs ) (** ) Sudoku.
230+
231+ [ P98] ( src/Misc/P98.hs ) (*** ) Nonograms.
232+
233+ [ P99] ( src/Misc/P99.hs ) (*** ) Crossword puzzle.
37234
38235## Running tests
39236
0 commit comments