Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
0 of .
Results for:
P. 1
datastructures lab programs

# datastructures lab programs

Ratings:

5.0

(1)
|Views: 1,822|Likes:

### Availability:

See more
See less

03/10/2014

pdf

text

original

DATA STRUCTURES LABORATORY
LIST OF EXPERIMENTS
1)Implement singly and doubly linked lists.2)Represent a polynomial as a linked list and write functions for polynomial addition.3)Implement stack and use it to convert infix to postfix expression4)Implement a double-ended queue (dequeue) where insertion and deletion operations are possible at both the ends.5)Implement an expression tree. Produce its pre-order, in-order, and post-order traversals.6)Implement binary search tree.7)Implement insertion in AVL trees.8)Implement priority queue using binary heaps9)Implement hashing with open addressing.10)Implement Prim's algorithm using priority queues to find MST of an undirected graph.
Total: 45LTPC0032

DATA STRUCTURES LABORATORYList of Experiments:1.Singly Linked List.2.Doubly Linked List.3.Polynomial Addition.4.Infix to Postfix Expression.5.Double Ended Queue.6.An Expression Tree.7.Binary Search Tree.8.AVL Tree.9.Priority Queue using Binary Heap.10.Hashing with Open Addressing.11.Prim’s Algorithm.

EX:NO:1
a.
To implement singly linked list and performing insert, deleteand search operations.
ALGORITHM:
1.Set a node to contain INFO and LINK fields.2.Allot memory dynamically for a node and declare it as aheader H.3.To create a singly linked lists get the element N andallot memory for a node S1.4.Set S1->INFO=N; and S1->LINK=NULL.5.Repeat the above two steps for all the elements.6.A node can be inserted at the front, in the middle or atthe end of the list.7.To insert a node X at the front check whether the listis empty, if not setX->LINK=H->LINK and H->LINK=X.8.To insert a node X at the end travel till the end of thelist and assign the last node’s LINK value to X.9.To insert a node X after the specified node Y, travelthe list till the node Y is reached. Set X->LINK=Y->LINKand Y->LINK=X10. A node can be deleted at the front, in the middle or atthe end of the list.11.To delete a node X at the front set H->LINK=H->LINK->LINK.12.To delete a node X at the end travel the list till theend and assign the previous to last node’s LINK value tobe NULL.