Laboratories for
Introduction to Data Structures and Algorithms II

Lab1
Accessing your server account
Lab2
Heaps and Heapsort
In this lab we will learn how to implement a heap utilizing a complete binary tree. The heap can then be used to implement a priority queue.
Next we will learn how to program Heapsort. Heapsort is an order N*log(N) sort that utilizes a Heap.

Lab3
Finding the Median of a List Efficiently
In this lab we will use a partition function to find the median of a list of numbers. We will, then, analyze the algorithm for best case, worst case and average case order of complexity. Finally we will extend our median finder into a sorting algorithm called median sort.

Lab4
Efficient Sorting Algorithms
In this lab we will investigate programming several efficient sorting algorithms. These will include QuickSort, ShellSort, RadixSort, BucketSort and BinSort.

Lab5
InsertSort - One more time
Since InsertSort plays a role in several other optimized sorts (ShellSort, QuickSort, MergeSort and others) we will
Lab6
Create a Visual C++ Project to implement a graph.

Lab7 - Write a C++ program that creates classes for nodes, edges and graphs. I.e., we will be creating ADTs for nodes, graphs and edges.
Lab8 - Here is a C++ program that uses the random number generator. The random number function in this program allows the caller to specify a range for the random numbers. You will need the random number generator for some of the exercises above. The C++ random number generator's seed function depends on the clock and sometimes does not produce a good set of random numbers when called multiple times in succession since the PC clock does not change very frquently. Here is another program that includes a modification of the seed function to produce better results and a random number function that returns a random number between 0 and a user-defined limit.

Lab9 - In this lab we will write a function to generate a random tree and another to generate a random graph. Pseudocode for algorithms given in this file include the generation of random trees & graphs




Top of this page   Top of page      Home page   Home page