cp5_6_ps08_s04 - Assume i The data field consists of a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CP5_6 The problems in this problem set cover lectures C5 and C6. 1. a. What are doubly linked lists? What is the record declaration for a node in a doubly linked list? (hint: see Feldman page 672, problem 8) b. Write an algorithm to insert a node into a sorted doubly linked list. Use a diagram to show the sequence of operations that have to be performed to carry out the insertion step. Hint: Extend the approach used in class/ notes for singly linked lists. c. Implement your algorithm as an Ada95 program.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Assume: i. The data field consists of a single integer. Turn in a hard copy of your algorithm and code listing, and an electronic copy of your code. 2. What is the Shortest Path through the graph shown below using Dijkstra’s algorithm? Show all the steps in the computation of the shortest path. b e a c d 1 2 10 5 7 3 2 9 4 6 3. Define the following terms (as applied to graphs): a. Walk b. Path c. Eulerian Path d. Cycle e. Degree of a vertex...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online