cpe360f09

# cpe360f09 - 879 572 434 111 242 811 102 5(10 points Show...

This preview shows pages 1–2. Sign up to view the full content.

1 CpE 360 – Computational Algorithms and Data Structures Fall 2009 Instructor: Yingying (Jennifer) Chen Homework 5 – Due on 12/11/09 (Friday) All solutions must be submitted in class by the due date. No late submission will be taken into consideration. The work you turn in must be your own personal work, composed and written by you. Note: Solutions must be readable (especially handwriting!!), concise, complete and must include pledge of the Honor system. 1. (10 points) Sort the sequence {3, 1, 4, 12, 5, 9, 2, 6, 8} using insertion sort. Please show each intermediate step after each pass. 2. (10 points) What is the running time of insertion sort if all elements are equal? 3. (15 points) Show each step of Shellsort on the input {9, 8, 7, 6, 5, 4, 3, 2, 1} using step {7, 3, 1} 4. (15 points)Show each step how heapsort processes the input {142, 543, 123, 65, 453,

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 879, 572, 434, 111, 242, 811, 102} 5. (10 points) Show each step of sorting {3, 1, 4, 1, 5, 9, 2, 6} using mergesort. 6. (10 points) Find a topological ordering of the graph below. Show your steps. 2 7. (15 points) Shortest paths for weighted and unweighted graphs: (a) Find the shortest weighted path from vertex A to all other vertices (b) Treat the below graph as unweighted, find the shortest unweighted path from B to all other vertices. 8. (15 points) (This is a programming assignment). Implement bubble sort algorithm. Please submit your C++ program, your inputs, and your output which should print out the each step during sorting of your inputs. You can try to make up inputs with size 10 elements in it....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

cpe360f09 - 879 572 434 111 242 811 102 5(10 points Show...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online