DS UNIT-I 2 Marks
DS UNIT-I 2 Marks
DS UNIT-I 2 Marks
UNIT – I
1. What is Data Structure?
A data structure is a mathematical or logical way of organizing data in the memory that
consider not only the items stored but also the relationship to each other and also it is
characterized by accessing functions.
5. What is ADT?
An ADT is a set of operation. A useful tool for specifying the logical properties of a data
type is the abstract data type.ADT refers to the basic mathematical concept that defines the
data type. Eg.Objects such as list, set and graph along their operations can be viewed as
ADT's.
Union, Intersection, size, complement and find are the various operations of ADT.
6. Define Algorithm.
Algorithm is a solution to a problem independent of programming language. It consist of set
of finite steps which, when carried out for a given set of inputs, produce the corresponding
output and terminate in a finite time.
7. What are the features of an efficient algorithm?
a. Free of ambiguity
b. Efficient in execution time
c. Concise and compact
d. Completeness
e. Definiteness
f. Finiteness
11. What are the various operations done under list ADT?
a. Print list
b. Insert
c. Make empty
d. Remove
e. Next
f. Previous
g. Find kth element
1. PUSH
2. POP
23. What are the applications of Stack ADT?
1. Conversion of infix to postfix
2. Evaluation of expression
3. Function calls / recursive calls
4. Balancing symbols
5. Conversion of numbers
ADT operations:
CreateQueue,
ClearQueue,
FullQueue,
EmptyQueue,
AppendQueue (enqueue) and
Serve (dequeue or remove).
Way of Implementation:
It can also be implemented using both array (static approach)and linked list (Dynamic
approach).
27. What is LIFO? Name the ADT which one uses LIFO operation.
LIFO - Last In First Out. Stack ADT uses LIFO operation.
28. What is FIFO? Name the ADT which one uses FIFO operation.
29. Write algorithm for inserting a node at the beginning of the list ADT.
If(start == NULL)
{
Start = newnode();
}
Else
{
Newnode->next = start;
Start = newnode;
}
30. Define Recursion?
Recursion is a function calling itself again and again.
31. Write postfix from of the expression –A+B-C+D?
A-B+C-D+
32. What are the postfix and prefix forms of the expression?
A+B*(C-D)/(P-R)