Professional Documents
Culture Documents
Trees, Heaps, Priority Queues, Tries, Pt. 2 Practice Session
Trees, Heaps, Priority Queues, Tries, Pt. 2 Practice Session
Trees, Heaps, Priority Queues, Tries, Pt. 2 Practice Session
Tries, pt. 2
Practice Session
Azamat Ordabekov
Delete a node from Binary Heap
Given a Binary Heap (max heap). What happens if we delete a tree
root? Explain step by step
Delete a node from Binary Heap
Problem Set: Binary Search Tree Sum
Given Binary Search Tree. Write a function, which returns the sum of the
tree.
Example:
Input: Output: 128
15
/ \
7 35
/ \ /\
1 10 20 40
Problem Set: Binary Search Tree Sum
This problem can be solved by using recursion.
Tree Structure: