PracticeFinalExamQuestions.pdf - CS165 Practice Final Exam...

This preview shows page 1 - 6 out of 37 pages.

Page1CS165, Practice Midterm Problems, Spring 2020CS165Practice Final Exam QuestionsA full list of topics for the Final is available as a separate PDF document linked from the CourseSchedule page. The final exam iscomprehensive. Thus, when you review the material, you mustinclude the topics that were covered before Midterm 1, between Midterm 1 and Midterm 2, and afterMidterm 2.For your convenience, we have included the practice materials from the three parts ina singledocument.These items are inreverse order(i.e., most recent first).
Page2CS165, Practice Midterm Problems, Spring 2020PART IThis part of the practice problem set corresponds to Weeks 13-15.HashingGraphsExpression Trees
Page3CS165, Practice Midterm Problems, Spring 2020EXPRESSION TREES – 1Using the expression tree shown below, answer the following questions:1.Show the postfix expression represented by the tree, with spaces between each token, and noleading or trailing spaces.2.Show the infix expression represented by the tree, with spaces between each token, and no leadingor trailing spaces.3.Show the prefix expression represented by the tree, with spaces between each token, and noleading or trailing spaces.4.What does the expression evaluate to, assuming integer math and the normal Java order ofoperations, which are of course reflected in the prefix and postfix forms and the tree? Do this usingthe tree, and verify the answer using the infix expression.
Page4CS165, Practice Midterm Problems, Spring 2020EXPRESSION TREES – 2Given the infix expression (29 – 3) * 4 / 6 + 68 % (3 + 10), answer the following questions.5.Create an expression tree that represents this expression.6.Show the postfix expression represented by the tree, with spaces between each token, and noleading or trailing spaces.7.Show the prefix expression represented by the tree, with spaces between each token, and noleading or trailing spaces.8.What does the expression evaluate to, assuming integer math and the normal Java order ofoperations, which are of course reflected in the prefix and postfix forms and the tree? Do this usingthe tree, and verify the answer using the infix expression.
Page5CS165, Practice Midterm Problems, Spring 2020HASHING9.Withlinear probing, in which entry in the left hash table will thecolliding object with key15be stored? Which entry would be used forquadratic probing? The table size is13, and the hash function is asimple modulo of the integer key. Also list the indices that are triedunsuccessfully.LINEAR PROBING:QUADRATIC PROBING:

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 37 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
N/A
Tags

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture