clASSMAte
Date :
Page:
Data Structure
Intervin
uestions
By: Qcurious-programmer.
1What is a Data Structure
. Datq stru cture method that organizing
the dlata in memoTY.
9ata strueture is specialized format for
organizing cessing
proces retrieving & storing
data.
Data gtructure includes Arrgy, Pointe,linked,
list, stack , Queye, Structure, graph Searching
Sorting Proqrams etc.
9atastructyre 0s not a
programning lagage
A
It i9 set of algorithm is use in any progrd
mming language to store +he datq in memory .
Types of datg structures
is Liner data structyre.
ii) Non-linegr datq structure.
|Dnto
Poga:
2 b a t is Line ar data structure
In lioeqr datq stru cture elements gre stored
seqyentialy
egchelement are connected to previou
And
and nert element.
Linked listStack and Qyeue dre different
Aray
types of lineqr data structures
qvailable -
Lioeg dat structure dre egsy to implement
3What is non-ine gr oata structure?
qre not
In non-linedr datq strucfure elements
qrranged sequenially.
structure is not easy to
Non-linegr data
implement.
device memor effi cienty
Trees qod qraph gre examples of non-inear
datq strueture.
@rious-proqamner
4Wbat is aTTay
An data structure for storinq
more than one dat item that bassimilar
data types.
An aray stored thdt position of each 'element
can be computed from its index by its formla.
In an grray se arching of element is. eqsy by
usingindex number.
Date:
Page:
5 hat is mutidimensional ardy ?
A multidimengionl array is with more than
one dimension.
IE is un qray of aray
2-D array qre most ornmony us ed.
dre used to store data in tu buwar
Thg
manner.
QcurIOUJ-" proqrammr
6Wha is lioke list in data structure ?
I} js a seqyence of data stTUcture, wbich
qre connected toqether via liok9.
Eqch liok contan a connection to anoth erliok.
. Linked list can grow &shrink its size,
per the requrement
It does not wdaste memory spaee
TYpes of linked lists:
Singly linked list
) Doubly linked list
n) Circular linked list
7hat is stdck ?
Stqck is a linear data structure.
" stqck follows LIFO(Last Lo First Out ) or FILO
(First In Last Out).
In gtack elements dre ddded from top
- And element can deleted on from stek. top.
CIASSMALe
Doto:
Page:
Enter 2 Enter 3 2
EoeF-4
8What is queue data stru cture.
ueue is a linegr datg structure
It follows First Io First out (FIFo)
Once a new element ie ineer ted into queue
all elements ineerted before new element in
qyeue must be emoved to nenove ne eement
curiou 3--proqramme
Back Front
6
First In First Out
Out
CIASSMACe.
Dato :
Poge:
gWhat is Tree iD Data structure?
"Tree data strucure i a kind of biergrchical
data drranqe in d tree like stru cture.
This tree consist of foe cetral node, structural
node, and gub nodes
consist of node that node stores a value.
The topmost node called root node.
WRoot
Edqe
Pdrent sibtings
4
Children Leaf nodes
@curious-proqrammer
oWhat is qraph
’ A Graph i9 Consist of podes &edqes.
.Noes dre aleo called vertices
that conn ects nodes in c
&edge qre
Graph lo oks like cyclie tree.
CIASSMAte
Dato :
|Page:
Edqe
Vertices
@curious-.proqrammer
15 What is n alqorithm
An alqorithm is a step by step method of
solving a problem.
:Lt define6 a 6et of instruction to be enecuted
in certain order to get correct output:
The algorithm designed gre language independ.
and
1shat is merge sort?
Merqe sort divides he qrray into two parts
then sort it and combine it
It takes time of (n logn) io Worst cqse.
17 hat is selection sort
. In sele ct ion sort to find the minimum
element io eve iteratiÝn. and place it in
the aray bsgioning from "ist ndex.
Selection sort also avided oto sorted and
unsorted subaYTIY
CIASSMMA
Oata :
Pago:
I8bat 15 PUSH in DS ?
" The PUSH operator is used to insert
element in the stack
PUSH operation insert a ned element at the
top of stack.
If insert a new element io full sta ck , a overflow
condition occurS
PUSH gdd one element on top of the stack.
Last In First Out
CUSH POP
Dta Data
Oatq
ata
ta pota
Stqck
Qcurious-proqramer
Iglhat is Pop IO . S
’ The Pop operator is used to remove
element from stack.
POP operation removes q element from
top of stack.
stack underFlow condition occur cohen sta ck
1s empty and we try to delete element
from atack.
CIASSMAte
Dnto :
| Pago:
,
20/
What dynamic D.s ?
IE is colle ction of data in memery that
expand and contract to grou or shrink
in size q a proqram rUns.
This enables the proqrammer to control
exa ct how much memory is to be utili2ed.
Examples : dynamie arra linkedlist, stack,
queue, and heap.
21]|| bat are Some applications oF OS.7
curioug-.proqramme
Numerical naysis operating system,
Artifici al inteligen ce, gimwation, compiler
design, statistiear anaysis, graphics,
databgse managemment
22
What is a postfix expression?
A postfix expression is collection of operator
and operands in which the operator is
plqced after. the operands.
Lo a postf ix exprression the opeator Follows
the operands.
What is dequeue?
Seque i a type of queye in which insertion
renmovay of element can eithen be-peformed
from the front or the rear.
It not follows FIFO Rule
|Dato :
Pago:
24 hat binary trees ?
are
A binary treé is a tree datg strueture
cwhi eh each parent node can have at
most tro children
We named it Left child and right child.
Sinary tree contain:
i Poioter to Left child.
n) Pointer to Right chil.
curious-.-praqrg mmer.