Assignments in Data Structure

ASSIGNMENT  1

1. Write an interactive menu driven program in C++ to
                                a. Create a polynomial using array/linked list
                                b. Add/Delete a term in a ploynomial

2. Write an interactive menu driven program in C++ to
                                a. Add two polynomials
                                b. Multiply two polynomials

3. Write an interactive menu driven program in C++ to
                                a. Compute derivative of the given polynomial
                                b. Compute definite integral of the given polynomial
                                c. Compute inverse of the given polynomial
                                d. Factorise a given polynomial
                                e. Compute partial fractions
     Indicate explicitly the limitations of your program.

Last date  for submission : 23.01.2001 upto 5:00 p.m. One mark will get deducted for every 1 day delay in submission. Either send your programs  by e-mail or give printouts. I am always available in afternoon after 1:30 pm in MiniComputer/Intel  Lab except Wednesday.
________________________________________________________________________________________________________________________________________________________________

ASSIGNMENT 2

IMPORTANT INSTRUCTIONS :
1. For every program take the input from a file and write its output to a file.
2. Last date of submission :  19.02.2001* ( for both the assignments )
3. Only on  20.02.2001* you have to show the demonstration at computer centre from 9:00 a.m. onwards.
     Without demonstration, submission will not be accepted.*
4. Send your programs by e-mail only.
* changes are highlighted in red

1. Write a program in C++  to convert an infix expression into prefix.  The input expression must include the following operators :
    +     -     *     /     (     )     ^(exponentiation)
   and single character as an operand.

2. Write a program in C++  to  simulate  queues occuring  at railway reservation counters. Assume the following :
2.1 There are three counters available.
2.2 Persons are arriving  at a constant rate.
2.3 Service time may vary from one person to another.
Determine at any point in time number of persons available in each queue and average delay (waiting time) per person.
-------------------------------------------------------------------------
ASSIGNMENT 3*
*added problem 3.2
IMPORTANT INSTRUCTIONS :
1. For this program take the input from a file and write its output to a file.
2. Last date of submission :  12.03.2001 (problem 3.1), 28.03.2001 (problem 3.2)
3. Only on 24.04.2001 you have to show the demonstration of problems 3.1 and 3.2 at computer centre from 9:00 a.m. onwards.Without demonstration, submission will not be accepted.
4. You may do the assignment in group of 2
5. Send your programs by e-mail only.

Problem 3.1 :
                Write a program in C++ to implement a threaded binary search tree in which each node has a key which is a string of upto 20 characters and an int count. Read the input from a textfile word by word, inserts each new word in the input into the tree and keep a count of the number of occurences of each word in the text. Thus count is set to 1 when a word is first encountered in the text and is incremented every time the same word is found. Write the word and its occurences  in alphabetical order in an output file. Submit all your source file, text file and output file.

Problem 3.2 :
              Repeat the problem 3.1 to implement balanced threaded binary search tree. Also write the code for deleting a given node.
----------------------------------------------------------------
ASSIGNMENT 4
IMPORTANT INSTRUCTIONS :
1. Last date of submission :  23.4.2001
3. Only on 24.04.2001 you have to show the demonstration of assignments 3.1, 3.2 and 4 at computer centre from 9:00 a.m. onwards.Without demonstration, submission will not be accepted.
4. You may do the assignment in group of 2
5. Send your programs by e-mail only.

Important : Please make it a point that there will be no further extension of the last date now.

Assume a computer network where every router keeps  a packet in a queue. The service time is fixed for any given router (they are different for different routers). Assume a packet originates at router A and travels to router B through the shortest path. The path length is defined as the sum of the queue lengths seen by this packet. The path is computed at the originating router and remains fixed even if the queue lengths change as the packet travels through the network.

The queue at each router is a simple FIFO queue with no priorities and infinite capacity.

Generate a random network of 25 routers and 100 links (make sure it is connected). Generate packet at each router using random number between 5 and 1000 miliseconds and assign the destination randomly.
Compute average traveling time between each pair of nodes. Report the smallest and largest five .

------------------------------------------------------------------------------------------------------------------------------------------

Name : Ajay Agarwal
email : aagar@cse.iitd.ac.in