Skip to content

Commit fc7949d

Browse files
author
Mari Wahl
committed
new version book with the first 2 chapters edited, examples added
1 parent 5161f9d commit fc7949d

File tree

3 files changed

+23
-36
lines changed

3 files changed

+23
-36
lines changed

book/book_second_edition.pdf

-3.32 KB
Binary file not shown.

src/builtin_structures/primes_generating.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/trees/check_largest_item.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python
2+
3+
__author__ = "bt3"
4+
5+
6+
from binary_search_tree import BST, Node
7+
8+
def largest(node):
9+
10+
if node.right:
11+
return largest(node.right)
12+
return node.item
13+
14+
15+
if __name__ == '__main__':
16+
17+
18+
bst = BST()
19+
l = [10, 5, 6, 3, 8, 2, 1, 11, 9, 4]
20+
for i in l:
21+
bst.add(i)
22+
23+
print(largest(bst.root))

0 commit comments

Comments
 (0)