0% found this document useful (0 votes)
50 views5 pages

DSA Questions for Students

The document contains questions related to data structures and algorithms. It includes questions on topics like data structures, arrays, linked lists, time and space complexity analysis, and operations on linked lists.

Uploaded by

landgesantosh240
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views5 pages

DSA Questions for Students

The document contains questions related to data structures and algorithms. It includes questions on topics like data structures, arrays, linked lists, time and space complexity analysis, and operations on linked lists.

Uploaded by

landgesantosh240
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Questions Bank of DSA

Unit I & II

1. What is a data structure? Why do we need data structures? List some common data
structures.
2. How data structures are classified? Differentiate linear and non-linear data structure.
3. Define ADT (Abstract Data Type).
4. Why pointer arrays are efficient than arrays. Justify your answer by taking an example.
5. Explain the Row and Column major storage representation in 1-D & 2-D Array.
6. Given an array, arr[1………10][1………15] with base value 100 and the size of each
element is 2 Bytes in memory. Find the address of arr[8][6] with the help of row-major order.
7. Given an array arr[1………10][1………15] with a base value of 100 and the size of each
element is 4 Bytes in memory find the address of arr[8][6] with the help of column-major
order.
8. What are the types of linked lists? How the singly linked lists can be represented?
9. How the doubly linked list can be represented? Draw the node structure of a double linked
list.
10. When singly linked list and doubly linked list can be represented as circular linked list?
11. What are the advantages of linked list? Mention the demerits of linked list.
12. What are the operations performed in list? What are the applications of “linked lists”?
13. In how many ways we can arrange elements of a 2D array in memory? What is pointer
array?
14. Differentiate static data structure and dynamic data structure.
15. What are the merits and demerits of array implementation of lists?
16. What is a circular linked list?
17. Advantages of Array over Linked List. Disadvantages of Array over Linked List
18. Advantages of Linked List over Array. Disadvantages of Linked List over Array.
19. Explain the operations of singly linked lists and doubly linked list.
20. How polynomial manipulations are performed with lists? Explain the operations.
21. Explain the steps involved in insertion and deletion into a singly and doubly linked list.
22. What is doubly linked list. Write the declaration of doubly linked list in C/C++.
23. With the C program explain how the elements are inserted and deleted from a doubly linked
list.
24. List out any two applications of linked list and any two advantages of doubly linked list over
singly linked list.
25. Write a pseudo C/C++ code on the following operations on singly linked list & doubly linked
list.
A. Insertion before head node.
B. Insertion after last node.
C. Delete the first node.
D. Delete the last node.

26. Define Big Oh(O), Big Omega(Ώ), Big Theta(θ) Notation.


27. Explain Time & Space Complexity with a proper example.
28. Identify the following function in increasing order of growth.
i. √𝑛, log log 𝑛, 𝑛/ log 𝑛, (log⁡𝑛)2
ii. 2𝑛 , 𝑛3/2 , 𝑛𝑙𝑜𝑔(𝑛), 𝑛log 𝑛
iii. log log 𝑛, 𝑛log 𝑛 , √log 𝑛, 𝑛√𝑛
29. What is the time complexity of the following codes:
a) int i, j, k = 0;
for (i = n / 2; i <= n; i++)
{
for (j = 2; j <= n; j = j * 2)
{
k = k + n / 2;
}
}
b) int a = 0, i = N;
while (i > 0) {
a += i;
i /= 2;
}
c) for(var i=0;i<n;i++)
i*=k;
d) var value = 0;
for(var i=0;i<n;i++)
for(var j=0;j<i;j++)
value += 1;
e) #include<stdio.h>
Main()
{
int i, j, k = 0;
while(i<=n)
{
j=2;
while(j<=n)
{
k = k + n / 2;
j = j ++;
}
i++;
}
}
f) main()
{
int ans = 0;
for(i =1;I<=n;i++)
for(j = i; j <= n; j += i)
{ ans += 1;
printf(“%d”, ans);
}
}
g) int arr = [];
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
arr[i * n + j](i + j);
}
}
h) void function(int n)
{
int i = 1, s = 1;
while (s < n) {
s = s + i;
i++;
}
}
i) void fun(int n)
{
if (n < 5)
printf("MCA");
else {
for (int i = 0; i < n; i++) {
printf("%d", i);
}
}
}
j) void fun(int n, int x)
{
for (int i = 1; i < n; i = i * x) //or for(int i = n; i >=1; i = i / x)
print("MCA");
}
k) void fun (int n)
{
for (int i = 0; i < n; i=i+2)
for (int j = 1; j + n / 2 <= n; j++)
for (int k = 1; k <= n; k = k * 2)
cout << "Data Structure & Algorithm";
}

l) void fun(int n)
{
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j = j + i)
print("Data Structure & Algorithm ");
}
m) void fun(int n)
{
for (int i = 0; i <= n / 3; i++)
for (int j = 1; j <= n; j = j + 4)
cout << "MCA";
}
n) void fun(int n)
{
int i = 1;
while (i < n) {
int j = n;
while (j > 0) {
j = j / 2;
}
i = i * 2;
}
}

You might also like