# CSC 3102 — Advanced Data Structures & Algorithm Analysis

## Homework 3

1. (5 points) Will the operations of deleting $$i$$ and then $$j$$ from a binary search tree leave the same tree as deleting $$j$$ and then $$i$$? Argue why it is or give a counterexample.

2. (5 points) Will the operations of deleting $$i$$ and then $$j$$ from an AVL tree leave the same tree as deleting $$j$$ and then $$i$$? Argue why it is or give a counterexample.

3. (10 points) Consider the following graph $$G$$. For now, ignore the values associated with the edges. Give the list of vertices visited in depth-first order beginning at vertex $$B$$. When given a choice of which vertex to push next, push them in alphabetical order.

4. (10 points) Given the same graph $$G$$, give the list of vertices visited in breadth-first order beginning at vertex $$B$$. When given a choice of which vertex to enqueue next, enqueue them in alphabetical order.

5. (20 points) Given the graph $$G$$, and using the edge values as weights. Trace Dijkstra’s algorithm to compute the shortest distances from vertex $$S$$ to every other vertex. For every vertex draw the shortest path leading to it.