Cisc 220 final exam questions &
answers 2024/2025
does calling by reference change the value? - ANSWERSyes
does calling by value change the value? - ANSWERSno
examples of by reference (2) - ANSWERSpointer to an array, pointer to an array of structs
examples of by value (2) - ANSWERSpointer to a struct, pointer to an array in a struct
list all of the sorting algorithms we have covered (9) - ANSWERSbubblesort, bucketsort, heapsort,
insertionsort, mergesort, quicksort, radixsort, selectionsort, shellsort
four efficiencies in order from slowest to quickest - ANSWERSO(n), O(n^5/4), O(nlogn), O(n^2)
bubble sort efficiencies (for order, rev order, avg) - ANSWERSO(n), O(n^2), O(n^2)
bucket sort efficiencies (for order, rev order, avg) - ANSWERSO(n), O(n), O(n)
heap sort efficiencies (for order, rev order, avg) - ANSWERSO(nlogn), O(nlogn), O(nlogn)
insertion sort efficiencies (for order, rev order, avg) - ANSWERSO(n), O(n^2), O(n^2)
merge sort efficiencies (for order, rev order, avg) - ANSWERSO(nlogn), O(nlogn), O(nlogn)
quick sort efficiencies (for order, rev order, avg) - ANSWERSO(n^2), O(n^2), O(nlogn)
, radix sort efficiencies (for order, rev order, avg) - ANSWERSO(n), O(n), O(n)
selection sort efficiencies (for order, rev order, avg) - ANSWERSO(n^2), O(n^2), O(n^2)
shell sort efficiencies (for order, rev order, avg) - ANSWERSO(n^5/4), O(n^5/4), O(n^5/4)
what is a full tree? - ANSWERSevery node has 0 or 2 non-null children
what is a complete tree of height h? - ANSWERSa tree that is filled up to depth h-1, and at depth h any
unfilled nodes are on the right
what is a binary tree? - ANSWERSevery node in the tree has at most 2 nonempty subtrees
what is the preorder tree traversal used for? - ANSWERScopying
preorder tree traversal steps - ANSWERSvisit root, traverse left, traverse right
what is the inOrder tree traversal used for? - ANSWERScreating sorted lists
inOrder tree traversal steps - ANSWERStraverse left, visit root, traverse right
what is the postorder tree traversal used for? - ANSWERSdeleting
postorder tree traversal steps - ANSWERStraverse left, traverse right, visit root
at most how many steps are necessary to find any number in a balanced BST? - ANSWERSbetween 2^n-1
and 2^n nodes
Since AVL trees are binary search trees, the tree makes sure that every node can be reached in ____ or
less - ANSWERSO(logn)