Saturday, 21 November 2015
Thursday, 19 November 2015
AKASH PATIL's BLOG
DSC LAB PROGRAMS
STACK
1.Stack operation:
i).Assign to a variable name Y the value of the
third element from the top of the stack and keep the stack undisturbed.
ii) Given an arbitrary integer n pop out the top n elements.
A message should be displayed if an unusual condition is encountered.
iii) Assign to a variable name Y the value of the
third element from the bottom of the stack and keep the stack undisturbed.
2. Write a program to determine if an input
character string is of the form XxY. X is x string of arbitrary length using
only the characters from A and B. For example, X may be ABBAB. Y is a string
which is the reverse of X. Thus for the string X given above, Y is BABBA. A is
any arbitrary character which is not A or B. Given ABAAxABAB the program should
display a message that this string is invalid. For the string ABBAxABBA the
program should write a message that it is valid. Use appropriate data
structure.
3. Write a C program that parses Infix arithmetic
expressions to Postfix arithmetic expressions using a Stack.
QUEUE
1. Write a C program to simulate the working of
Messaging System in which a message is placed in a Queue by a Message Sender, a
message is removed from the queue by a Message Receiver, which can also display
the contents of the Queue.
SINGLY
LINKED LIST
1.Write a C program to accept 2 singly linked lists
& print the elements which are common in both the lists.
2. Consider a linked list with n integers. Each node
of the list is numbered from 1 to n. Develop a program using 'C' language to
split this list into 4 lists so that:
a. First list contains nodes numbered 1,5,9,13,_,_,_
b. Second list contains nodes numbered 2,6,10,14,_,_
c. Third list contains nodes numbered 3,7,11,15,_,_
d.Fourth list contains nodes numbered 4,8,12,16,_
3. Implement a program to multiply two polynomials
using circular linked list.
DOUBLY LINKED
LIST
1. Implement working of lift using appropriate data
structure(DOUBLY LINKED LIST).
1. Lift always goes from GROUND_FLOOR floor to
TOP_FLOOR and comes back to GROUND_FLOOR and so on.
2. At any floor, people can enter and give the
details of desired floor
3. When the floor they want to go, comes, all those
who had selected the floor leave the lift
4. You cannot call the lift from outside.
5. This lift attends each floor, even if no person
requests from outside
2. Design a doubly linked list to represent sparse
matrix. Each node in the list can have the row and column index of the matrix
element and the value of the element
BINARY TREE
1. Write a C program to create Binary Tree and
provide insertion and deletion operations and to traverse the tree using
In-order, Preorder and Post order using recursive method.
2. Given a String representing a parentheses-free infix arithmetic
expression, implement a program to place it in a tree in the infix form. Assume
that a variable name is a single letter. Traverse the tree to produce an
equivalent postfix and prefix expression string.
3. Implement a simple Dictionary using Trees and
Hashing.
OTHER
1. Open Address Hashing:
Write a C
program to implement Hashing using Open Addressing.
2. MAX Binary Heap:
Write a C
program to Build Binary Heap to simulate Priority queue.
Subscribe to:
Posts (Atom)