Data Structure Practical Questions
Data Structure Practical Questions
Arrays:
1. Consider two single dimensional Array of size 20 and 30 respectively.
Write a program in C to find out the elements which are common in
both arrays.
9. The name roll number and marks of 10 students are stored in an array
named marks. Write a program to find the Name of first, second and
third rank holder.
10. The mode of an array of numbers is the number m in the array that is
repeated most frequently. If more than one number is repeated with
same maximal frequencies, there is no mode. Write a program in C
that accepts an array of numbers and returns the mode or an
indication that the mode does not exist.
Searching:
1. Twenty five numbers are entered from the keyboard into an array. The
number to be searched is entered through the keyboard by the user. WAP to
find if the number to be searched is present in the array and if it is present,
display the number of times it appears in the array.
Sorting:
1. Given are two one-dimensional arrays A and B which are stored in ascending order.
Write a program to merge them into a single sorted array C that contains every item from
arrays A and B, in ascending order.
Stacks:
1. Write a program in C to implement Stack using Array.
(A+B^D)*(D/E)
Queues:
1. Write a program in C to implement Queue using Array.
Linked Lists:
1. Consider that a single linked list contains the following elements:
3. WAP that reads the name, age and salary of 10 persons and maintain
them in a linked list sorted by name.
4. There are two linked lists A and B containing the following data:
A: 3, 7,10,15,16,9,22,17,32
B: 16,2,9,13,47,8,10,1,28
WAP to create A linked list C that contains only those elements that are
common in linked list A and B.
A: 7,5,3,1,20
B: 6,25,32,11,9
Write a function to combine the two lists such that the resulting list
contains nodes in the following elements:
7,6,5,25,3,32,1,11,20,9
Trees:
1. Write a program in C to insert new nodes to a binary search tree and
delete a node from binary search tree.
4. Write a program in C and find the time complexity for in-order traversal
of a binary tree.
8. Given any number, find whether that number is present in the binary
tree. If present then find the level at which it is present.
Files:
1. Write a program in C to append some text after the contents of a
simple text file “text.txt”.
2. Write a program in C for insertion and deletion records from a
sequential file.