Public class mystery private brstructinteger tree

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a stack, First ­In First ­Out (FIFO) or Last ­In First ­Out (LIFO)? What is the access policy of a (time ­ordered) queue, First ­In First ­Out (FIFO) or Last ­In First ­Out (LIFO)? 5 [ CSE116 – EXAM 2 – VERSION 1 ] FALL 2011 Question 5 [10 marks] Show the binary search tree which results when the following items are inserted, in the order given, into an initially empty binary search tree. To receive full marks you must show what the tree looks like after each insertion. Ensure that the order property of a binary search tree is satisfied at each step. 50 70 60 20 90 40 65 35 6 [ CSE116 – EXAM 2 – VERSION 1 ] FALL 2011 Bonus question [5 marks] Study the following code, then answer the questions on the following page. Note that you should focus on how the insert method operates (the code in bold below). Notice that ‘%’ refers to the remainder operator: x % y produces the integer remainder of the integer division x / y. public class Mystery { private BRStruct<Integer> _tree;...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online