cp5_6_ps08_s04

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

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

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.
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

## This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Ask a homework question - tutors are online