1
+ using NUnit . Framework ;
2
+ using System ;
3
+
1
4
using LaYumba . Functional ;
2
5
using LaYumba . Functional . Data . LinkedList ;
3
6
using static LaYumba . Functional . Data . LinkedList . LinkedList ;
4
7
5
- using NUnit . Framework ;
6
- using System ;
8
+ using LaYumba . Functional . Data . BinaryTree ;
9
+ using static LaYumba . Functional . Data . BinaryTree . Tree ;
7
10
8
11
namespace Exercises . Chapter9
9
12
{
10
13
static class Exercises
11
14
{
12
- // LISTS: implement functions to work with the singly linked List defined in this chapter:
15
+ // LISTS
16
+
17
+ // Implement functions to work with the singly linked List defined in this chapter:
13
18
// Tip: start by writing the function signature in arrow-notation
14
19
15
20
// InsertAt inserts an item at the given index
@@ -28,13 +33,24 @@ static class Exercises
28
33
// DropWhile:
29
34
30
35
// number of new objects required:
36
+ // InsertAt:
37
+ // RemoveAt:
38
+ // TakeWhile:
39
+ // DropWhile:
31
40
32
41
// TakeWhile and DropWhile are useful when working with a list that is sorted
33
42
// and you’d like to get all items greater/smaller than some value; write implementations
34
43
// that take an IEnumerable rather than a List
35
44
36
45
37
- // TREES: Implement a LabelTree type, where each node has a label of type string and a list of subtrees;
46
+ // TREES
47
+
48
+ // Is it possible to define `Bind` for the binary tree implementation shown in this
49
+ // chapter? If so, implement `Bind`, else explain why it’s not possible (hint: start by writing
50
+ // the signature; then sketch binary tree and how you could apply a tree-returning funciton to
51
+ // each value in the tree).
52
+
53
+ // Implement a LabelTree type, where each node has a label of type string and a list of subtrees;
38
54
// this could be used to model a typical navigation tree or a cateory tree in a website
39
55
40
56
// Imagine you need to add localization to your navigation tree: you're given a `LabelTree` where
0 commit comments