Data Structure (KCS 301) Tute 1

You might also like

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

F:/Academic/27

Refer/WI/ACAD/18

SHRI RAMSWAROOP MEMORIAL GROUP OF PROFESSIONAL COLLEGES


B.Tech. [SEM III (IT & CS All groups)]
TUTORIAL SHEET-1[Revised]
(Session: 2019-20)
DATA STRUCTURE
(KCS-301)
Unit: I Topic : Introduction
Date of Distribution: 07/08/19 Faculty: Prof. Ajay Kr. Srivastava, Dr. R.G. Tiwari,
Mr. Amit Sachan

SUBJECTIVE QUESTIONS:

Q1. Explain row major and column major representation of 2D array with example.
Q2. Write a C Program to find the number of non repeated elements in an array.
Q3. What is dynamic memory allocation? Explain different functions used for dynamic memory allocation in
C programming language.
Q4. Write a C function to delete an element at mid position in doubly linked list.
Q5. What are diverse built in Data Types in C? Explain them with their size and range.
Q6. Write a C function to sort a Doubly Linked List.
Q7. Write a C function to delete duplicate elements from singly linked list.
Q8. Write a C function which accepts the starting address of two polynomials represented using Linked lists,
adds both polynomials and returns the address of resultant polynomial.
Q9. Write a C function that creates a new linear linked list by selecting alternate elements of given linear
linked list.
Q10. Write a C function to concatenate two circular linked lists.
Q11. Find the O notation for following functions:
a) f(n)= 5n3+n2+6n+2
b) f(n)=4n3+2n+3
c) f(n)=6n2+3n+2n
d) f(n)=10n5+7
e) f(n)=8n8+4n4+2n2
Q12. Write a C program to reverse the links of a given singly linked list.
Q13. Write a C function to insert an element at last position in doubly circular linked list.
Q14. Explain the procedure of multiplication of two polynomials represented using Linked list. Demonstrate
multiplication operation on following polynomials:
Poly1: 3x2 + 5x1 + 6,
Poly2: 6x1 + 8

Q15. Write a C Program to find two elements in the array such that difference between them is largest.

SUPPLEMENTARY QUESTIONS:
1. Given any two functions f(·) and g(·), show that f(n) + g(n) = Θ(max{f(n), g(n)}).
2. We are given a recursive algorithm which, given an input of size n, splits it into 2 problems of size
n/2, solves each recursively, and then combines the two parts in time O(n). Thus, if T(n) denotes the
runtime for the algorithm on an input of size n, then we have: T(n) = 2T(n/2) + O(n)
Prove that T(n) = O(n log n).
SHORT ANSWER TYPE QUESTIONS:
Q1) What are the different algorithm design techniques?
Q2) Why is doubly linked list more useful than a singly linked list?
Q3) What is the basic difference between calloc() and malloc() ?
Q4) Explain the use of typedef in brief.
Q5) Give the advantages and uses of circular linked lists.
Q6) How the members of a structure can be accessed?
Q7) What is meant by finiteness of an algorithm?
Q8) What do you mean by derived data types?
Q9) What is the primary advantage of a linked list?
Q10) What is the range of signed and unsigned char data type?

CROSSWORD PUZZLE:
ACROSS
2 ……… function allocates a chunk of memory on
the heap and returns a pointer to it
6 Name of array acts as a ………………
7 …….is the procedure or formula for solving a
problem, based on conducting a sequence of
specified actions.
9 In the ……. case analysis, we calculate lower
bound on running time of an algorithm
10 ….operator can be applied on integer operands,
not on float or double operands.
11 A……….. relation is an equation which is
defined in terms of itself.
14 When we precede a struct name with……., the
struct becomes a new type.
15 …pointer does not point to any variable.

DOWN
1 ……data types are defined by its behavior
(semantics) from the point of view of a user of
the data.
3 ……..notations are mathematical tools to
represent time complexity.
4 The …..case running time is an upper bound on
running time for any input.
5 A …… is a special data type available in C that
allows to store different data types in the same
memory location.
8 In call by …….addresses of variables are passed
to function.
12 …….function is used to reallocate/change the
previously allocated memory.
13 …..statement is used to terminate the loop.

REFERENCES:-
1. Aron M. Tenenbaum, Yedidyah Langsam and Moshe J. Augenstein “Data Structure Using C and
C++”, 2nd edition, PHI, 2007.
2. Horowitz, Sahani, and Anderson-Freed, “Fundamentals of Data Structures in C”, 2nd edition,
Universities Press, 2007.
3. Lipschutz, “Data Structures”, 2nd edition, Schaum’s Outline Series, TMH, 2006.
4. Dilip Kr. Sultania, “Data Structures Using C”, 1st edition, Techmax, 2007.

Signature of the Faculty: __________________ Signature of the HOD: _________________

You might also like