{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SYSC2002_2001_Winter

SYSC2002_2001_Winter - DURATION Department Course...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
r!} BP .. , @ ~ Carleton UNIVERSITY 94.202D Final EXAMINATION Winter 2001 DURATION: 3 HOURS No. of Students: 79 Department Name & Course Number: Systems & Computer Engineering 94 -202D Course Instructor(s) J. Bryant AUTHORIZED MEMORANDA No calculators, 1 8.5x11 sheet of notes both sides Students MUST count the number of pages in this examination question paper before beginning to write, and report any discrepancy to a proctor. This question paper has 11 pages. This examination question paper MAY NOT be taken from the examination room. In addition to this, question paper, students require: an examination booklet yesO n~ a Scantron sheet yesO nO4]{ Student Name: Student Number:.' , Question 1 (8 marks) Given the tree class definitionsbelow, write a method which returns'true if the tree is sorted and false if it isn't. public class Tree { m~:§~~ private class Node { int key; Node left, right; } private Node root; . "" -.//yourmethod... --public boolean isSorted () { } } You will probably want to have "i~_Sorted" call another method (if you don't, this could be a long exam) This is fine aslong as you write the other method. Write your method(s) in the space on the f~_llbwingpage. ---===;=~:.c~ ~"'" ',; .= ---~~-- ~~:
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
" gp .C~ public boolean isSorted () { ..IEEE Carleton " , ~ , - } 94.202 Page 2. of 11 ..-" , ,..'
Image of page 2
.~p .~J ~~:ttt-~;~ Question 2 (8 marks) ~~~~_.~~::;;;;..J In addition to the RR and LL rotations covered in assignment #8, tree balancing can also require LR and RL rotations. The effects of an LR rotation are illustrated below. " After rotation .- .. Before rotation In the space on the next page, write a method which perfonns an LR rotation. Your method should accept a reference to the subtree's original root node (i.e. node "~"
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern