# Study Guide — midterm CS260 — Data Structures

## Rules

You must know your name, student ID, user ID, ad section #.

You may bring, by way of a cribsheet, a single 8.5 &mult; 11 piece of paper, hand-written, double-sided. This should be for quick reference only. If you're looking at the paper for inspiration, you're probably thinking a little wrong. We're looking for your brain, not a parakeet.

Please turn all cell phones off (unless you are expecting a child). You may not talk on the phone, nor text during the exam. You may not use a calculator, nor any other device. No headphones/music, either.

Remember, where we ask for an algorithm, we also want you to provide some run-time analysis.

There are (roughly) 130 points that you may attempt on this exam. Only the first 100 of them will do you any good. The short of this is that you don't need to finish the whole thing. Please skim through the questions before you start, to avoid wasting a lot of time on a question that you're just not feeling at that moment.

## Topics for Study

### Asymptotic Analysis

Providing bounds (upper and lower) on execution time, and space required.

• Big-O
• Big-Ω
• Θ

### Basic (low-level) Linear Containers

• Arrays (vectors)
• Circular buffers
• Lists

Understand the time required for the various operations on these containers, and the space required.

### Basic Adapters: Stacks and Queues

Be able to implement each of these on an array, and on a list.

### Trees

• Vocabulary
• root
• internal node
• leaf
• child
• parent
• ancestor vs. proper ancestor
• descendant vs. proper descendant
• path
• Be able to compute:
• height
• size
• traversals (in–, pre–, postorder)
• Height of trees (best, worst)
• Various implementations:
• List of references
• Parallel arrays
• Single array
• Left-most child/right sibling
• Hufman encoding

### Sets & Dictionaries

A dictionary is a set of (key, value) pairs.

Be able to describe operations, along w/associated runtimes of the various set operations using the following implementations:

• ordered and unordered lists
• ordered and unordered arrays
• hash tables
• binary search trees (BSTs)
• trie

### Priority Queue

Sets with a min (max) operation.

• heaps