Midterm Exam 1 - Data Structures and Programming | ECS 110, Exams of Data Structures and Algorithms

Material Type: Exam; Professor: Joy; Class: Data Structures & Prog; Subject: Engineering Computer Science; University: University of California - Davis; Term: Fall 2003;

Typology: Exams

Pre 2010
On special offer
30 Points
Discount

Limited-time offer


Uploaded on 07/31/2009

koofers-user-wo0-1
koofers-user-wo0-1 🇺🇸

10 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECS 110
Data Structures and Programming
Midterm Examination #1
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. What are the primary operations of a stack? What are the primary
operations of a queue?
pf3
pf4
pf5
pf8
pf9
Discount

On special offer

Partial preview of the text

Download Midterm Exam 1 - Data Structures and Programming | ECS 110 and more Exams Data Structures and Algorithms in PDF only on Docsity!

ECS 110

Data Structures and Programming

Midterm 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. What are the primary operations of a stack? What are the primary operations of a queue?
  1. What are the advantages of a doubly-linked list over a singly-linked list? What are the disadvantages? Be complete here!
  1. Given the list of integers

4, 7, 10, 3, 2, 9, 1, 5

exhibit a binary tree that, when traversed in inorder, outputs the list in ascending order.

  1. Given the list of integers

4, 7, 3, 10, 2, 9, 1, 5, 12

Add each of these integers to a Min heap. Show the structure of the heap before and after each insertion. Note: We want the minimum value at the top.

  1. The solution to the subway problem is frequently called a “backtracking” algorithm. Explain this term as it applies to the subway problem.
  1. Illustrate a binary search tree which is not an AVL tree, but one that can be made into an AVL tree by using one single rotation. Show the result of the single rotation on the tree.