You are on page 1of 4

ANNA UNIVERSITY : CHENNAI 600 025 B.E/B.

.TECH DEGREE EXAMINATION, OCT/NOV 2012 IT 2205 - DATA STRUCTURES AND ALGORITHMS LAB B.TECH INFORMATION TECHNOLOGY III SEMESTER Regulations - 2008 Time: 3 Hours 1 Maximum Marks: 100 100

Write a function in C to create a list using singly linked list. The list should contain the following numbers 30, 50, 20, 10, 45, 65, 05. Write functions to insert an item at given position, to delete an item at given position, to find an item in the list and to display the items in the list.

Write a function in C to create a list using doubly linked list. The list should contain the following language Software namely C, C++, C#, Java, PASCAL, BASIC, COBOL. Write functions to insert an S/W name at given position, to delete a S/W name at given position, to find a S/W name in the list and to display the S/W name in the list in reverse order

100

Write a function in C to create two sorted list L1 and L2 using singly linked list. The List should contain integer numbers only. Write a function using only the basic list operations to generate list L3 which should contain the union of two list L1 and L2

100

Write a function in C to create two sorted lists L1 and L2 using singly linked list. The List should contain integer numbers only. Write a function using only the basic list operations to generate list L3 which should contain the intersection of two lists L1 and L2

100

Write a function in C to represent polynomial as linked list. Each node of the list should contain the degree and coefficient of the polynomial. Write a function to add two polynomials. Execute your program for the following inputs a) Polynomial 1: Polynomial 2: b) Polynomial 1 : 5 x 6 + 7 x 4 + 10 x 1 + 20 3x4+8x3+4x1 10 x 4 + 3 x 3 + 8 x 2

100

Polynomial 2:

8 x 10 + 6 x 8 + 5 x 4 + 2 x 3 + 9 x 2 + 10

Write functions in C to implement the stack with its basic operations either using linked list or using an array. Using the basic operations of the stack, push the following characters into the stack and print them in the reverse order. T,E,C,H,N,O,L,O,G,Y Input;

100

Write functions in C to implement the stack with its basic operations either using linked list or using an array. Using the basic operations of the stack, convert the following infix notation to postfix notation. Input : A * ( B + C) / D * E ^ F G + H

100

Write functions in C to implement the circular queue with its basic operations using an array of size 6. Using the basic operations of the queue, Enqueue the following subject code and Dequeue them in the same order Input : 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210

100

Write functions in C to implement the circular queue with its basic operations using an array. Using the basic operations of the queue, simulate the producer and consumer problem.

100

10 Write functions in C to construct an expression tree using Stack. Write a function to produce the preorder traversal of the expression tree. Input: A B C * + D E * F + g * 11 Write functions in C to construct an expression tree using Stack. Write a function to produce the postorder traversal of the expression tree . Input: A B C * + D E * F - g * + 12 Write functions in C to construct an expression tree using Stack. Write a function to produce the inorder traversal of the expression tree . Input: A B C * - D E * F + g * + 13 Write a function in C to implement Binary search tree. Write functions to insert an integer, to find an integer and to find the largest integer in the binary search tree. Input : 60, 30, 70, 35, 65, 67, 37 Insert 29, find 70 & 31

100

100

100

100

14 Write a function in C to implement Binary search tree. Write functions to insert an integer, to delete an integer and to find the smallest integer in a binary search tree. Input: 60, 30, 70, 35, 65, 67, 37 Insert 80, delete 60 & 35

100

15 Write a function in C to implement priority queue using min heap. The property of min heap is value at the parent node should be less than or equal to the values of its children node. Using the operations of the min heap, print following integers in ascending order Input: 75, 65, 89, 12, 34, 3, 56, 10, 25, 80 16 Write a function in C to implement priority queue using max heap. The property of max heap is value at the parent node should be greater than or equal to the values of its children node. Using the operations of the max heap, print following integers in descending order Input: 75, 65, 89, 12, 34, 3, 56, 10, 25, 80 17 Write a program in C to implement hashing using linear probing method. Let the hash table size be 10. Hash the following integers and display the contents of the hash table Input: 45, 23, 26, 75, 34, 93, and 67. 18 Write a program in C to implement hashing using quadratic probing method. Let the hash table size be 10. Hash the following integers and display the contents of the hash table Input: 45, 23, 26, 75, 34, 93, and 67. 19 Write a program in C to implement Dijkstras algorithm using priority queue to find the shortest path from the source vertex to all the remaining vertices in the given graph. Graph: Source vertex : V1

100

100

100

100

100

20 Write a program in C to implement Backtracking algorithm for knapsack problem

100

You might also like