Part 7 Flashcards
when is a binary tree balanced?
If for every non-leaf node the number of nodes in its left child and right child differ by no more than 1
What is the average and worst case time complexities for binary search tree operations?
Average O(logn)
Worst O(n)
The depth of a balanced binary tree containing n nodes is exactly
floor(log2n) + 1
When would it make sense to ensure a binary tree stays balanced?
If it will be searched frequently but not inserted or removed frequently
Rebalancing a tree takes at least ___________ time in the worst case
O(n)
What is another term for dept-balanced?
AVL-Balanced
What does depth balanced mean?
for every non-leaf node the depth of its left child and the depth of its right child differ by no more than one
The depth of any AVL-Balanced tree containing n nodes is no more than
_________
as long as n > 1
2log2n
What is an AVL tree?
A depth balanced binary search tree
The rebalancing of an AVL tree can be performed in __________ time
constant
The time taken to deduce whether an AVL tree needs rebalancing is proportional to
its depth
Searching, insertion and deletion for AVL trees can be performed in _________ time
O(logn)
What is the most efficient way of storing information in AVL tree nodes?
Simply store details of which child is deeper
Functions that are computable using the Church-Turing definitions can be implemented in which programming language?
Any
What is the halting problem?
The question of whether a program will terminate when run with specific data, specifically:
can we write a program taking source code and input as strings that will determine whether the program in the source will terminate with the data