Vous êtes sur la page 1sur 4

1. if the initial top=-1 then what is the condition for stack is empty?

Ans : if(top==-1 ) stack is empty


2. what is data structure?
Ans : organizing, maintaining, and retrieving data in an efficient manner with certain set of
rules(axioms).

3. What is an abstract data type?


Ans : Mathematical model for a certain class of data structures, with set of Operations defined on
those data structure.

4. what is an data objects?


Ans : set of different/same data type elements grouped together is called as data object. (Array)

5. what is primitive data type?


Ans : Predefined data type is called as primitive data type

6. What is stack?
Ans : a stack is a last in, first out (LIFO) abstract data type and linear data structure.

7. what is queue?
Ans : a FIFO data structure, the first element added to the queue will be the first one to be removed.

8. write and explain the algorithm of stack?


Insert()
if(top==max)
Stack is Full
else
top=top+1
stack[top]=element
Delete
If(top==-1)
Stack is empty
else
element=stack[top]
top=top-1
Return ele

9. what are the operations associated with Queue?


Insert
Delete
display

10. Explain the insertion and deletion in circular Queue with algorithm, and graphical
representation for
every element inserted and deleted with all the conditions?
11. Convert an expression from infix to postfix and prefix?
Infix = A+B*C
Postfix = ABC*+
Prefix =+A*BC

12. What is linked list?


Ans :A linked list is a data structure consisting of a group of nodes which together represent a
sequence. Under the simplest form, each node is composed of a datum and a reference (in other
words, a link) to the next node in the sequence

13 What are the operations associated with linked list?


Insert
Insert at beginning
Insert at end
Insert at middle
Delete
Delete at beginning
Delete at end
Delete at start

14. What is double linked list?


Ans : a doubly linked list is a linked data structure that consists of a set of sequentially linked
records called nodes. Each node contains two fields, called links, that are references to the previous
and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next
links, respectively

15. What are the operations associated with double linked list?
Ans : Insert
Insert at beginning
Insert at end
Insert at middle
Delete
Delete at beginning
Delete at end
Delete at start

16. What is self referential structure?


Ans : A structure referring to itself is called as self referential structure

18. What is circular linked list?


In a circularly linked list, all nodes are linked in a continuous circle, without using null. For lists
with a front and a back (such as a queue), one stores a reference to the last node in the list. The next
node after the last node is the first node. Elements can be added to the back of the list and removed
from the front in constant time.
19. what are the different types of data structures?
Ans : Linear data structure, Non-Linear Data structure
20. Give an example of self referential structure in C?
Struct node{
Int data;
Struct node *link;
};
21. if front=-1 and rear=-1 then what is the condition for Queue full?
if(Front==rear)
Queue is full
22. if front=-1 and rear=-1 then what is the condition for Queue empty?
If(rear==-1)
Queue is empty
23. if the initial top=0 then what is the condition for stack is empty?
Ans : if(top==0 ) stack is empty
24. Convert 11+2*3+1*2-6/3 what is its equivalent expression in postfix? What is the output if it
executes?
Ans :
-++1123*12*63/
O/p=17

25. Define DFS(depth first search)?


Ans : Is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the
root (selecting some node as the root in the graph case) and explores as far as possible along each
branch before backtracking.

26. Define BFS(breadth first search)?


Ans breadth-first search (BFS) is a graph search algorithm that begins at the root node and explores
all the neighboring nodes. Then for each of those nearest nodes, it explores their unexplored
neighbor nodes, and so on, until it finds the goal.

27. Define Graph?


Ans A graph data structure consists of a finite (and possibly mutable) set of ordered pairs, called
edges or arcs, of certain entities called nodes or vertices. As in mathematics, an edge (x,y) is said to
point or go from x to y.

28. Define Tree?


Ans : tree is a widely-used data structure that emulates a hierarchical tree structure with a set of
linked nodes.

29. What is minimal spanning tree?


A minimum spanning tree (MST) or minimum weight spanning tree is then a spanning tree with
weight less than or equal to the weight of every other spanning tree.

30. What is Binary tree?


Ans a binary tree is a tree data structure in which each node has at most two child nodes, usually
distinguished as "left" and "right". Nodes with children are parent nodes, and child nodes may
contain references to their parents. Outside the tree, there is often a reference to the "root" node (the
ancestor of all nodes), if it exists. Any node in the data structure can be reached by starting at root
node and repeatedly following references to either the left or right child.

31. Define depth of the tree?


Ans : Depth of the tree depends upon the number of leaf nodes.

32. what is a root node in a tree?


Ans : starting node in a treee, through which you can visit all the child nodes in the tree.

33. What type of Data structure is a tree?


Ans Non-linear

34. What type of data structure is a graph?


Ans : Non -linear

Vous aimerez peut-être aussi