Data Structures and Programming Final Examination - Prof. Kenneth I. Joy, Exams of Data Structures and Algorithms

The final examination questions for a data structures and programming course, covering topics such as binary trees, heaps, avl trees, graph algorithms, and sorting. Students are required to answer questions involving balanced binary trees, inorder and postorder traversals, max heaps, avl trees, and minimum cost spanning trees.

Typology: Exams

Pre 2010

Uploaded on 07/30/2009

koofers-user-2er
koofers-user-2er 🇺🇸

10 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECS 110
Data Structures and Programming
Final Examination
Name__________________________________________________
Directions:
This is a closed-book test. Answer all questions on the paper
provided. Use the backs of the provided paper if you need
extra space.
1. Given the list of integers
4, 7, 10, 3, 5, 9, 1, 6
exhibit a balanced binary tree that, when traversed in inorder, outputs the
list in ascending order.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Data Structures and Programming Final Examination - Prof. Kenneth I. Joy and more Exams Data Structures and Algorithms in PDF only on Docsity!

ECS 110

Data Structures and Programming

Final Examination

Name__________________________________________________

Directions:

This is a closed-book test. Answer all questions on the paper

provided. Use the backs of the provided paper if you need

extra space.

  1. Given the list of integers 4, 7, 10, 3, 5, 9, 1, 6 exhibit a balanced binary tree that, when traversed in inorder, outputs the list in ascending order.
  1. Given the following tree. If visiting a node causes the numerical value at the node to be printed, give the output of a postorder, inorder and preorder search of the tree.
  1. What is an AVL tree? What is the property that defines it? Be precise here!
  1. Given the alphabetical list

I, C, E, Z, Y, S, B, T, A, L, K

Exhibit a balanced binary tree that, when traversed in postorder, outputs the list in ascending order.

  1. Given the following graph, show a spanning tree that represents a depth- first search of the tree starting from cell F.
  1. Given the following graph, outline the use of Prim’s algorithm to generate the minimum cost spanning tree from node A. What is the shortest path generated from node A to node G?
  1. Consider the following binary search tree, which is not an AVL tree. What AVL operations are necessary to rebalance the tree? Show the resulting AVL tree and the operations you have used to balance the tree.
  1. Consider the following binary search tree, which is not an AVL tree. What AVL operations are necessary to rebalance the tree? Show the resulting AVL tree, and the operations you have used to balance the tree.