



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




The prerequisites for CSCE 451/851 are CSCE 231 and 310. This purpose of this assignment is to evaluate your understanding of the prerequisite knowledge. You may consult any textbook or other resource to complete the assignment, but do the work on your own. This is not a group project.
Consider the following definitions for functions that operate on a stack S. A) MAKENULL(S). Make stack S be an empty stack. B) EMPTY( S ). Return true if S is an empty stack; return false otherwise. C) TOP( S ). Return the element at the top of stack S. The element is not deleted from the stack. D) POP( S ). Delete the top element of stack S. E) PUSH( x, S ). Insert x at the top of stack S. The old top element becomes next- to-top, and so on.
Consider the following tree:
1 4) Answer the following questions about the tree. A) Which nodes are leaves? B) Which node is the root? C) What is the parent of node B? D) Which nodes are children of B? E) Which nodes are ancestors of G? F) Which nodes are descendants of G? G) What are the siblings of G and E? H) Which nodes are to the left and to the right of J? I) What is the depth of node M? J) What is the height of node M?