Lecture 7 Flashcards
What are the runtimes of sorted arrays?
What are the three pointers every node has in a binary search tree?
What property do all keys follow in a Binary Search Tree?
Are BST’s unique?
No, multiple BST can follow the BST key property
How to do search in a BST?
What is the pseudocode for search in BST?
How to find min/max in a BST?
What is the pseudocode for max/min in a BST? What is the runtime?
How to do insert in a BST?
What is the pseudocode of insert in a BST? What is the runtime?
What are the ideas of the steps of deleting in a BST?
What are the steps of removing an element of a BST which has one child?
What are the steps of removing an element of a BST which has two children?
What is the best case of Search, Insert and Deleting of a BST? When does this happen?
O(log2(n)), when the BST is perfectly balanced
What is the worst case of Search, Insert and Deleting of a BST? When does this happen?