Data Structure Assignment
Data Structure Assignment
(i) Find that the length of each dimension and number of elements in X and Y,
(ii) Find the address of element Y(2,2,3), assuming Base address of Y=400 and each element occupies 4 memory
locations.
3) How to represent the polynomial using linked list? Write a C program to add two polynomials using linked list.
4) Discuss doubly linked list. write an algorithm to insert a node after a given node in singly linked list.
6) Use the merge sort algorithm to sort the following elements in ascending order
8) Convert the following infix expression to reverse polish notation expression using stack.
11) Consider the following infix expression and convert into reverse polish notation using stack
A+(B *C - ( D / E ^ F ) * H)
((A- ( B + C) * D) / ( E + F))
15) What is meant by circular linked list? write the functions to perform the following operations in a doubly linked
list.
16) Define collision. Discuss the techniques used to resolve collisions during hashing.
17) Write the C-function for the following operations(Consider dynamic implementation):
b) Insertion of an element in an ordered linked list (The list contains elements in ascending sequence of
their weights)
18) a)What do you understand by complexity of an algorithms? Compute the worst case complexity for the
following C code:
main()
int s=0,i,j,n;
for (j=0;j<3*n);j++)
for(i=0;i<n; i++)
s=s+i;
printf("%d",j);
}}
b) Write the difference between malloc and calloc functions. Why do we use dynamic memory allocations?
19) Write the procedures for insertion, deletion and traversal of a queue.
20) Explain the upper triangular and lower triangular sparse matrices. Suggest an space efficient representation for
space matrices and determine the address determination formulas for it.