1. Complete the following function that will take li, a SinglyLinkedList object
as parameter and will reverse the list li.
void List::reverseList(List * li){
}
2. Complete the following function that will convert a decimal number into a
binary number. You have to use a stack to get full credits.
int decimalToBinary(int num) {
}
3. Arrange the following functions in order from least to greatest.
274n+9804 480+37
n! nlogn -17n+204 231.
4. Convert the following infix notation to postfix. Then evaluate the post fix
expression. Show all the steps and the state of the stack. 24 + 32 * ( 9 – 39)
/ 6
5. Complete the following function that will count the number of non-leaves in a
tree. (Hint: You have to use recursion). Also give the runtime of the function.
int BST::numNonLeaves(TreeNode * t) {
}
6. Suppose you have a Binary Search Tree of integers. Complete the following
function that will remove a particular element from the BinarySearchTree. For
your convenience, you can assume that there is no duplicate elements in the
Binary Search Tree.
int BST::remove(TreeNode *t, int element) {
}