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

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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