Write the preorder traversal representation of the tree

Assignment Help Data Structure & Algorithms
Reference no: EM131111830

1. Consider the following graph:

a. Complete this table by finding the degree of each vertex, and identify whether it is even or odd:

1107_Figure.jpg

Vertex

Degree

Even/Odd

A

 

 

B

 

 

C

 

 

D

 

 

E

 

 

F

 

 

G

 

 

H

 

 

b. What is the order of the graph?

c. Construct the 10 x 10 adjacency matrix for the graph.

2. The graph below illustrates a switching network. The weights represent the delay times, in nanoseconds, travelled by a data packet between destinations, represented by the vertices.

828_Figure1.jpg

b. Complete the following table by finding the shortest distance and the path for that distance from vertex A to the other vertices:

Vertex

Shortest Distance from A

Path from A

B

 

 

C

 

 

D

 

 

E

 

 

F

 

 

G

 

 

H

 

 

I

 

 

b. What is the shortest distance between A and J and the path for that distance?

3. The following graph represents a portion of the subway system of a city. The vertices on the graph correspond to subway stations, and the edges correspond to the rails. Your job is to write a program for a cleaning car to efficiently clean this portion of the subway system.

2095_Figure2.jpg

b. Using Euler's theorem, explain why it is possible to pass through all of the stations by traversing every rail only once.
c. Using Fleury's algorithm, provide an optimal path to clean all the rails by passing through them only once.
d. Is it possible to find an optimal path described in question 3-b that starts on any station? Explain your answer.
e. Is it possible to find an optimal path described in question 3-b that starts and ends at the same station? Explain why or why not.

A network engineer lives in City A, and his job is to inspect his company's servers in various cities. The graph below shows the cost (in U.S. dollars) of travelling between each city that he has to visit.

303_Figure3.jpg

Find a Hamiltonian path in the graph.

a. Find a Hamiltonian circuit that will allow the engineer to inspect all of the servers. How much will the cost be for his trips?

b. Is there another Hamiltonian circuit that will allow the engineer to inspect all of the servers other than your answer in question 4-b? If so, calculate the cost.

Consider the following binary tree:

2138_Figure4.jpg

What is the height of the tree?

a. What is the height of vertex H?

b. Write the preorder traversal representation of the tree.

c. Write the array representation of the tree by completing the following table:

Vertex

Left Child

Right Child

A

 

 

B

 

 

C

 

 

D

 

 

E

 

 

G

 

 

H

 

 

I

 

 

J

 

 

K

 

 

L

 

 

M

 

 

N

 

 

O

 

 

P

 

 

Q

 

 

R

 

 

S

 

 

T

 

 

Consider the following weighted graph:

583_Figure5.jpg

• In the table below, choose the bracket that contains the first letter of your last name. Then, choose 1 value for a and 1 value for b from the numbers listed for your bracket. (Put your chosen values for a and b in the heading for your first post for the week, so your classmates will know which values you have chosen for each and so they will not choose the same values as yours. Be sure to choose a combination of a and b that is different from your classmates who have already posted or have chosen their values.) The values chosen will be the weights in the paths labeled a and b in the weighted graph above.

o I choose the following: a = 8, b = 6

Last Name Begins With

a

b

A-K

10, 14, 16, 5

4, 6, 9, 11

L-Q

5, 11, 13, 8

2, 7, 12, 15

R-Z

3, 8, 10, 19

13, 15, 17, 18


• In the weighted graph above, find the shortest path from node A to node E using Dijkstra's shortest path algorithm and using your chosen values for a and b.

o Explain your key steps in determining the shortest path, and give the node sequence that corresponds to that shortest path.

• Explain 2 examples where knowledge of a shortest path algorithm could be useful in an information technology career.

• Thinking of the graph above as undirected, does this graph have a Euler path? If so, give an example of such a path starting with a node you choose; if not, explain why not.

o Does this graph have a Euler circuit? If so, give an example; if not, explain why not.

• Does this graph have a Hamiltonian path? If so, give an example of such a path starting with a node you choose; if not, explain why not.

o If there is a Hamiltonian path, is there a Hamiltonian circuit? If so, give an example of such a circuit starting with a node you choose; if not, explain why not.

Reference no: EM131111830

Questions Cloud

Argumentative essay on your chosen controversial topic : Present the topic in a catchy introduction with one comprehensive thesis statement. Develop the argument and at least two counterarguments in a logical way.
Determining the role of advertising : Assume that you are going to start a small business of your own. Further, imagine that you are able to adequately differentiate your product, or service so that you can establish your business as a monopolistically competitive firm.
Negoatiation and critically asses the negoatiation process : Review what happend in the negoatiation and critically asses the negoatiation process by applying the various principles from the course reading .
Relationship with your writing process : After thinking about your answers, create an essay that discusses the nature of your relationship with your writing process. This essay should be a coherent essay that pulls your thoughts together under the umbrella of a central idea, a thesis. In..
Write the preorder traversal representation of the tree : Explain your key steps in determining the shortest path, and give the node sequence that corresponds to that shortest path - Write the preorder traversal representation of the tree.
Define number of strategy for encouraging physical activity : The article "SKIPing Toward an Active Start: Promoting Physical Activity in Preschoolers" describes a number of strategies for encouraging physical activity in young children. Select either toddlers or preschoolers and describe at least three deve..
What is the value of this bond to you : A bond with 5 years to maturity and a coupon rate of 6% has a par, or face, value of $20,000. Interest is paid annually. If you required a return of 8% on this bond, what is the value of this bond to you?
Calculate their values today base on their payment streams : You have two assets and must calculate their values today based on their different payment streams and appropriate required returns.Asset 1 has a required return of 15% and will produce a stream of $500 at the end of each year indefinitely.
Record suggested serving numbers to give quantitative value : Record the suggested serving numbers to give quantitative values to the categories you will build your diet around. List the pyramid categories in this order: "Vegetables," "Fruits," " Carbohydrates," "Proteins," "Fats," and "Sweets".

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Design a simple algorithm by giving pseudocode

Design a simple algorithm by giving pseudocode, for constructing a binary search tree T on n elements in O(nlogn) time with the property that any Find operation on T takes O(logn) time.

  Data and process modeling

The next phase in the project development cycle is to develop a logical model of the system based on the system requirements. The first step is about the "what" step. We need to show what the system will do, without worrying about how it will do..

  Difference between workbook and worksheet

Discuss the difference between a workbook and a worksheet and explain why would you want to use individual worksheets when using Excel?

  1 describe the jsp life cycledraw a diagram of the various

1. describe the jsp life cycle.draw a diagram of the various events and transformations.for each part of the cycle

  Briefly describe why you think it would be easier

You are involved in a debate with other IT systems analysts. Some of the analysts believe it is harder for the experienced analysts to learn the object modeling technique since they are accustomed to data and process modeling. Briefly describe why..

  Question about character array

The 2-most important design issues that are specific to character string types are the given, Should strings be simply a special kind of character array or a primitive type?

  Choose a combination of meaningful data structures

Describe a mechanism to access the telephone customer records by telephone #. Assume that we have a huge data in hand, say a million records or so.

  Write a program that reads a file and builds a linked list

Write a program that reads a file and builds a linked list. After the list is built display it on monitor. You may use any appropriate data structure, but it should have a key field and data. Two possibilities are a list of your favourite CD's or ..

  Describe the requirement for complex data structures

Describe the requirement for complex data structures and how they are utilized. Describe the design and application of arrays and how the array simplifies program development.

  Construct a process-flow diagram

Construct a process-flow diagram that illustrates the process of determining the incident containment strategy that would be used in this scenario, and identify which containment strategy would be appropriate in this case, through the use of graphica..

  Write the parametric form of the unit circle

Write the parametric form of the unit circle. Given an arbitrary positive integer n, write an algorithm that generates n evenly spaced points that are sampled along the unit circle

  Data structures

STACK; PUSH() and POP(). Static STACK Dynamic STACK Insertion Sort

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd