Part 2: Data Structure Basics
(5 pts) Show the order of visit using DFS and BFS to traverse the following graph, starting at node A (this is a directed graph): When you have more than one node to choose from, always choose the letter that comes first in the alphabet.
A binary search tree is a binary tree where the left child is smaller than the parent and the right child is greater than the parent. In the diagram below, the tree to the left is a BST and the tree to the right isn't.
Using the tree on the left in the picture above (the one with a green checkmark under it), answer the following questions:
a) Draw the tree after inserting the following numbers: 11, 5, 2, 13.
b) Does the order of insertion matter? In other words, if we insert the numbers in a different order such as 5, 11, 2, 13, would the resulting tree always have the same shape?