Searching and Spanning Trees

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

In the given tree, the pre-order depth-first traversal is given by _____.

{1, 2, 4, 5, 3}

In the given graph, a minimal spanning tree following Prim's algorithm would include which of the following edges?

{1, 3} - or - {2, 3} - or - {4, 6}

In the given graph, a minimal spanning tree following Kruskal's algorithm would include which of the following edges

{2, 8} - or - {5, 6} - or - {2, 3} - or - {0, 1}

In the given tree, the in-order depth-first traversal is given by _____.

{4, 2, 5, 1, 3}

In the given tree, the post-order depth-first traversal is given by _____.

{4, 5, 2, 3, 1}

Evaluate the postfix expression: 8 6 4 - ÷ 7 2 + *.

36

Translate the mathematical expression written in the prefix notation as +6*52.

6 + 2 * 5

Using Kruskal's algorithm, provide the list of ordered edges and the first edge to be added to the spanning tree. For a tie-breaker, use alphabetical order.

AC (1) AB (2) BD (2) CD (3) CB (4) DE (4) First edge = AC

In a _____ first search, the path is continued until a dead end is reached.

Depth

When building a binary tree to represent a mathematical expression, what process is followed to build the tree?

Order of operations

What traversal method traverses a tree on the left, then the right, and ends with the root?

Post-order traversal

In a _____ traversal, the root is always the first element in the list.

Pre-order

How is the first edge determined when creating a spanning tree using Kruskal's algorithm?

The edges are listed in order from least to greatest, and the edge with the lowest weight is the first edge added.

What is the main difference between prefix notation and postfix notation?

The main difference between the two notations is that the prefix is read from right to left and the postfix is read from left to right.

When building a binary tree for a mathematical expression, how are values and operators represented?

Values are leaves, and operators are parents.

Use in-order traversal to traverse the tree, and select the correct list.

a e l r s t v


Ensembles d'études connexes

AP Art History Global Contemporary

View Set