Professional Documents
Culture Documents
Year of study
Mr Richard Klein
Internal examiner(s)
x-76172
1. The code should implement push, pop, peek, and print. [10]
Page 2 of 6
Introduction to Data Structures and Algorithms
COMS1017 Lab Exam November 5, 2015
1. Implement print() that prints out every item separated by spaces. [5]
2. Implement delete(int i) that deletes that item at index i from the list. [5]
Page 3 of 6
Introduction to Data Structures and Algorithms
COMS1017 Lab Exam November 5, 2015
1. Implement the 3 traversal functions. Items should be printed out separated by spaces, a
space at the end of the line is acceptable. [10]
2. Implement the remove(int value) function that traverses to the correct link and
deletes that item from the BST. Your code must handle the following cases:
You can compile this code using make bst and run using ./bst
Page 4 of 6
Introduction to Data Structures and Algorithms
COMS1017 Lab Exam November 5, 2015
Page 5 of 6
Introduction to Data Structures and Algorithms
COMS1017 Lab Exam November 5, 2015
Page 6 of 6