Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 . 2 . In Figure 3 . 9 is shown a graph displayed with a circular layout. This graph is in fact a tree.

3.2. In Figure 3.9 is shown a graph displayed with a circular layout. This graph is
in fact a tree. If we assign the vertex 1 to be the root, and we assign an order to the
other vertices with respect to (i) their distance from the root and (ii) the order of
their labels among vertices of equal distance, then we have an ordered rooted tree.
Fig. 3.9 Graph corresponding to Exercise 3.2.
A preorder traversal of this tree is a walk that visits the root first, and then visits
the vertices of the first sub-tree in preorder, and then the second, in a recursive
fashion, yielding the preorder listing {1,2,4,5,3,6,7,8,9}. A postorder traversal
of this tree is a walk that traverses in postorder the vertices in the first sub-tree of
the root and then the second, in a recursive fashion, yielding the postorder listing
{4,5,2,6,8,9,7,3,1}.
Consider the following tree drawing algorithm. First, we assign a Cartesian coor-
dinate (xv,yv) to each vertex v, where xv is the rank of v in the preorder traversal
list, and yv, the rank in the postorder traversal list. Second, points are connected by
a straight line if their corresponding vertices are adjacent in the original underlying
graph. Implement this algorithm for the tree shown in Figure 3.9. Is your drawing
planar? What is its orientation? What is its effective area? How might you modify
the assignment of coordinates to vertices to reduce this area?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+ Are unions company-wide, regional, or national?

Answered: 1 week ago