FDS Theory Assignments
FDS Theory Assignments
ASSIGNMENT-02
1.Derive address calculation formula for one dimensional array with
an example.
2. Write a program to perform polynomial multiplication using
arrays.
3.What is sparse matrix? Explain with an example.
4.Write a program to perform the following operations:
a. find the length of the string.
b. concatenate two strings.
c. reverse the string.
5. Write a program to perform simple transpose of sparse matrix.
Discuss its time complexity.
ASSIGNMENT-03
1. Explain quick sort and sort the given list using quick sort:
[15, 8, 20, -4, 16, 2, 1, 12, 21, -2].
2. Write the algorithm for binary search and find its time
complexity.
3. Sort the following list using merge sort:
[55, 85, 45, 11, 34, 5, 89, 99, 67].
Discuss its space and time complexity.
4. Explain linear search with an example. State its time complexity
and compare it with binary search.
5. Sort the following using insertion sort:
[55, 85, 45, 11, 34, 5, 89, 99, 67].
ASSIGNMENT-04
1. Write an algorithm to perform the following operations on a
singly linked list:
a. Reverse
b. Sort.
2. Explain generalized linked list with an example.
3. Write a python code to represent doubly linked list as an
abstract data type[ADT]. (must include creating list, inserting
node, displaying/0.
4. Write a python code for polynomial addition using singly
linked list.
5. Write a python code to reverse a singly linked list.