DS Slips

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

S.Y.B.B.A.(C.A.

) Data Structure Slips


Slip 1
A) Write menu driven program using „C‟ for Binary Search Tree. The menu
includes - Create a Binary Search Tree - Insert element in a Binary Search Tree
- Display
B) Write a „C‟ program to evaluate a given polynomial using function. (Use
array).
Slip 2
A) Write a „C‟ program to accept a string from user and reverse it using Static
implementation of Stack.
B) Write a „C‟ program to create Circularly Doubly Linked list and display it.
Slip 3
A) Write a program to create two singly linked list of elements of type integer
and find the union of the linked lists. (Accept elements in the sorted order)
B) Write a „C‟ program to read the adjacency matrix of directed graph and
convert it into adjacency list.
Slip 4
A) Write menu driven program using „C‟ for Binary Search Tree. The menu
includes - Create a Binary Search Tree - Traverse it by using Inorder and
Postorder traversing technique
B) Write a „C‟ program to accept two polynomial and find the addition of
accepted polynomials.(use array)
Slip 5
A)Write menu driven program using „C‟ for Binary Search Tree. The menu
includes - Create a Binary Search Tree - Traverse it by using Inorder and
Preorder traversing technique
B) Write a „C‟ program to create linked list with given number in which data
part of each node contains individual digit of the number.
(Ex. Suppose the number is 368 then the nodes of linked list should contain 3, 6,
8)
Slip 6
A) Write menu driven program using „C‟ for Binary Search Tree. The menu
includes - Create a Binary Search Tree - Traverse it by using Preorder and
Postorder traversing technique
B) Write a „C‟ program to accept and sort n elements in ascending order by
using bubble sort.
Slip 7
A) Write menu driven program using „C‟ for Binary Search Tree. The menu
includes - Create a Binary Search Tree - Display - Delete a given element from
Binary Search Tree
B) Write a „C‟ program to create a singly linked list and count total number of
nodes in it and display the list and total number of Nodes.
Slip 8
A) Write menu driven program using „C‟ for Binary Search Tree. The menu
includes - Create a Binary Search Tree - Display - Search the element in Binary
Search Tree
B) Write a „C‟ program to accept and sort n elements in ascending order by
using insertion sort.
Slip 9
A) Write a program to accept a postfix expression and evaluate the expression
using the stack. Example: Input: ab+cd-*
Values: a=4, b=2, c=5, d=3 Answer: 12
B) Write a „C‟ program to create a singly linked list, reverse it and display both
the list.
Slip 10
A) Write a „C‟ program to read „n‟ integers and store them in a Binary search
tree and display the nodes level wise.
B) Write a „C‟ program to sort randomly generated array elements using
Insertion sort method. (Use Random Function)
Slip 11
A) Write a menu driven program using „C‟ for singly linked list-
- To create linked list.
- To display linked list
- To search node in linked list.
- Insert at last position
B) Write a menu driven program using „C‟ for Dynamic implementation of
Queue for integers. The menu includes

- Insert
- Delete
- Display
- Exit
Slip 12
A) Write a C program that accepts the graph as an adjacency matrix and checks
if the graph is undirected. The matrix for undirected graph is symmetric. Also
calculate in degree of all vertices - Read a graph as adjacency Matrix - Check
the matrix is symmetric or not - Calculate indegree of all vertices
B) Write a „C‟ program to accept and sort n elements in ascending order using
Selection sort method.
Slip 13
A) Write a C program to accept an infix expression and convert it into postfix
form.(Use Static Implementation of Stack) Example: - A * B + C as AB*C+
B) Write a „C‟ program to create doubly link list and display nodes having odd
value
Slip 14
A) Write a „C‟ program to accept a string from user and reverse it using
Dynamic implementation of Stack.
B) Write a „C‟ program to accept names from the user and sort in alphabetical
order using bubble sort - Accept n name
- Bubble sort Function
- Display
Slip 15
A) Write a „C‟ program to accept an infix expression, convert it into its
equivalent postfix expression and display the result.(Use Dynamic
Implementation of Stack.
B) Write menu driven program using „C‟ for Dynamic implementation of Stack.
The menu includes following operations:
- Push
- Pop
- Display
- Exit
Slip 16
A) Write a „C‟ program which accept the string and reverse each word of the
string using Static implementation of stack.
Example: Input - This is an input string Output - sihTsinatupnignirts
B) Write a „C‟ program to create to a Singly linked list. Accept the number from
user, search the number in the list. If the number is present display the Position
of node .If number not present print the message “Number not Found”.
Slip 17
A) Write a „C‟ program to read a postfix expression, evaluate it and display the
result. (Use Static Implementation of Stack).
B) Write a „C‟ program to accept the names of cities and store them in array.
Accept the city name from user and use linear search algorithm to check
whether the city is present in array or not.
Slip 18
A) Write a „C‟ program to read „n‟ integers and store them in a binary Search
tree structure and count the following and display it.
- Number of nodes
- Degree of tree
- Leaf nodes
B) Write a „C‟ program to accept and sort n elements in ascending order using
Merge sort method.
Slip 19
A) Write a „C‟ program which accept the string and reverse each word of the
string using Dynamic implementation of stack. Example: Input - This is an
input string Output - sihTsinatupnignirts
B) Write a „C‟ program to create a singly Link list and display its alternative
nodes. (start displaying from first node)
Slip 20
A) Write a „C‟ program which accept the string and check whether the string is
Palindrome or not using stack. (Use Static/Dynamic implementation of Stack)
B) Write a „C‟ program to swap mth and nth element of singly linked list.
Slip 21
A) Write a „C‟ program to read an adjacency matrix of a directed graph and
traverse using BFS.
B) Write a „C‟ program Accept n elements from user store it in an array. Accept
a value from the user and use linear/Sequential search method to check whether
the value is present in array or not. Display proper message.
Slip 22
A) Write a „C‟ program which accept an Expression and check whether the
expression is Parenthesized or not using stack. (Use Static/Dynamic
implementation of Stack)
B) Write a „C‟ program to count all non-zero elements, odd numbers and even
numbers in the singly linked list.
Slip 23
A) Write a menu driven program using „C‟ for singly linked list- - To create
linked list. - To display linked list - To insert node at last position of linked list.
- To delete node from specific position of linked list.
B) Write a „C‟ program to create a random array of n integers. Accept a value x
from user and use Binary search algorithm to check whether the number is
present in array or not. (Students can accept sorted array or can use any sorting
method to sort the array)
Slip 24
A) Write a „C‟ program to read a postfix expression, evaluate it and display the
result. (Use Dynamic Implementation of Stack)
B) Write a „C‟ program to remove last node of the singly linked list and insert it
at the beginning of list
Slip 25
A) Write a „C‟ program to read an adjacency matrix of a directed graph and
traverse it using DFS
B) Write a menu driven program using „C‟ for singly linked list- - To create
linked list. - To display linked list.
Slip 26
A) Write a „C‟ program to accept an infix expression, convert it into its
equivalent prefix expression and display the result. (Use Static Implementation
of Stack).
B) Write a „C‟ program to create two singly linked lists and concatenate one list
at the end of another list.
Slip 27
A) Implement Static implementation of circular queue of integers with
following operation: - Initialize(),insert(), delete(), isempty(), isfull(), display()
B) Write a „C‟ program to create Doubly Link list and display it.
Slip 28
A) Write a „C‟ program to create a Binary Search tree and implements
following functions - Create Binary Search Tree - Search a node in binary
search tree - Display a binary search tree (Post order Traversal)
B) Write a „C‟ program to read n integers and create two lists such that all
positive numbers are in one list and negative numbers are in another list.
Display both the lists.

Slip 29
A) Write a „C‟ program to create a Binary tree, traverse it using recursive
operations like inorder, preorder and postorder and display the result of each
one separately.
B) Write a „C‟ program to create Circular Singly Link list and display it.
Slip 30
A) Implement Dynamic implementation of circular queue of integers with
following operation: - Initialize(),insert(), delete(), isempty(), isfull(), display()
B) Write a „C‟ program to sort elements of a singly linked list in ascending
order and display the sorted List.

You might also like