Tree: Finite set of nodes.
Children: Roots of subtrees.
A directed edge refers to the link from the parent to the child (the arrows in the picture of the tree).
The root node of a tree is the node with no parents. There is at most one root node in a roote
Linear search Test all values. Random, unordered data.
Binary search Must be ordered. Splits array in half however many times required to find value.
Big O means in the order of. Characterization, not exact number of iterations. Worst case scenario.
Binary tree: At most 2 children
Every node has exactly one parent, other than root node. Can have multiple children. Binary is limited to
at most 2 children.
Multi-way has a maximum amount of branching
General tree nodes can have unlimited number of child
Intro to Theory of Computations
Universe of Problems: *Infinite computable and infinite non-computable problems*
Computability theory Given a problem, is it computable? Is there an algorithm that can solve it?
Exponential time Time or space co
Add: Get value, calculate hash. Each index is another list. If the list exists, call DLList add(), otherwise
create new list. Create an int index, increment after each add.
Probing: hash(hash(Object[Starting location, 0th probe]) + p (i) [i is nth probe])
1 2 3 4 5 = 15 Take pairs of any length of number and add together, then add those sums together.
Values from 1-N:
Number of pairs: N/2,
N * (N+1) = N2 + N Gives the total of a set of numbers.
*Three moves means: Hold value, replace with other value,
Data structure: Means of organizing data in a computers memory to try to optimize either the memory
usage or the time to access the data.
Asymptotic Measures: Measures time and space
Big O: Worst case scenario (Upper bound)
Big Omega: Best case (Lower bou
Midterm 2 starts with trees, ends with trees. No hash tables.
Study tree terms.
Height: Paths below to a leaf, not nodes. (Leaf height = 0)
Depth: Paths to the root from the node. (Root depth = 0)
Study structure of a BST / AVL tree. (AVL all nodes in a t