DSA Oral Questions-1

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

Page No.

Dete

2
Define qlobal declaationfunctions outside.
Dec lazing Varia bles of
any function for global acce ssibility
2.
De fine data types can hold.
Define the type of data avaziable
Ceg ntfloat.chax)

3 Define Naaiable itt eample 2


with
int ages= 25i
4 What is dicision makiag stateneat ?
Allows conditiDnal ee cution of code
Ceg. if else. switch)
het aae the vazious decision nakinq statemeat
available in
if, else Suoitchelseif teznazy opezato
Distinqui sh between Call by value Call by
sefe xence.
" Call by valye- Passesa copy of the Nalue.
" Call by zefexencei- PaSses the Naziable's_addoess

hatis asray
Colle ction of elemeats of the same example typ
gWhat i6 uo dimea sibnal aaãay
Matzix-like wth wS
and colums
Page No.
Date

Define is function a task


Codethat pexfozos a

Blo cK of
and Canbe eused

looping Gtatement
1oWhat aae the yazioug
avalable
fo ohile do- wh
whle.
DSA

pain eeg o2e pa0eef fectee in


ke c cod cht tet
paaguning
difecB
lloco
Iongaages
enipula ion of aeaC ey
hoe Valioug csegincudin

declealed to Ahe pointee


A poineg a spe.cicl.
nottee Veeicuble.
decloaee a poinee you Hhe
SHnbol.
Cnd
cohile steteaneat

- Used Eorg decision -aaking


of Cod once
EKecuteg o block
Candition eNalucteg to ee

21 whio Gletcanoat
" ged laopirg
Pos
Repeakdly. efecuteg o biock oF Codo
long
p20-poCeSSon in C
The p epaoce£s00 in
pooccsses the, Socece Code
pasged to tte Caapilee
Psoa

PecesiMe, Fachon
A cueeiMe, Fncton 8 a oction in
Dongananing ttet calls itselfeithee
dafectl4
aproblem.
ßn indrcectly in dgde2 to solve

l6 Iahat is the difEeseoce beteeen cohile Cod


doohile Sterteneot

THe condition
He losp bod
. checked befoen exesuing
Candiion S fal^e
21
docohile laop
The candition S
CARLmhing th chheakod cPe
loop body
DeFire opa2ata coith ekuaple
An opeeoto iG a chaeaceg on
that Pepeesets Cn obol
in aoteretics action an poocesS
pe. Conptee
Aeithonaic logiod.Relatiorod,
bitwnseetc gsinment
18 Canditiar4 opecto o teeneey
opcecto
" Canditionel opeeado.
The Candihiore oneeeton Cotso Called
Aeenoy aneeato)3 Cged in
Tengaoag to oke
decisiorg othin lire op Code.

The teLhaey opo-gotom Ba Shoethend Focn.


ie eI_e Gtetenent tet ctlo5 Fon
Camditionot
opeeato
19 Coonpc2e OE Gcotch ) cose cnd rested iE
Gtatet
Bath Scotch
Steteonents nd reosted
if setenets o-les Control Floo
bosed an Condifics
in eeag
Ayte, eec dobility. cnd
2o]Inhat cee Gleps iNolved in
J nitialization laoping slaleacat
2] Condihon check (Test Candition)
body
Capdale nceeoment
51 Ropot 0
Teoirate
Page No
Dete

2). Define break Strtement,


The break statenent is used to loop
OY a S t c h case prematurey, Skipping the
remining iterations or cases.

22 Define Pornter.
A nul pointer pointer that doesnot
point to any Vodid mermoy location it is usualy
initiallzed as n l cNULL)

23 compqre struetures.
Strctue.
Aray
A a S are the Homoqeneo Str ures dre Heterogene
data emets
-us d ata elements -0uS

AYays have same date cs+ructres cun haye


type 51eediefent ty pes

They can cceS5ed Using They Cqn acceSsed by

indices. mem bername

24. Compare stYutunes qnd unions.


Structure Unionn
Srueture keywd is used union Feyeoovd is sed to defiae
to deFine t he union type the Union type

nemoy qlfo coted For each memory loceted as per lyest


member.O member

Flexible urray is spprted Fbe plexible arruy is not


b +he stru ctre SuppcYted b4 the union,
Pags No
Data

25. Define structure i n c , t


-> Astu cture user-defined dat typein
c t a a t groupS diffrent variables (oF diffvent
types) under
Single nome.

26. Pules for declaring dStuctYe.


->1. eUs the struet keword.riio

Define the struetyre naean


2.

3. Enclose

hedeclaration ith senmicolon.


309poEnd

Define structue ponter


27.
->rstucturetpon ters ooinersthatpoint
strücture Nerable. They allow in direct
+o
Sructure mem bers
access to

De Pine union.
28. user- derined
Unib is data type in c
all hevmembersShde Sam
whene
but cqn storedìfrent
memySpace
types of data at diFfrent times

DeFine file
24.
storage
deyces
to Store data permandnty
Oganized in binay text foma
Pago No.
Dato

30. Define bìnay Files.


darta in binay foymat
Binayas)
(1s ¢
Files
qnd
store
are moe compact and
faster to ead dnd write than +ext
Files.
Pege No

Opening means accessin afile stazd


cOmptens de'eeto readarite
modifats Contents

Q:32 Define fseckc)l


fseek C) i s a funtion inthepzaazammig
lanqua qtpxatcle ba the Lstdio sh libxax
fo move the Sile pointex to a sph spe cifi
locodio. sithi file

Funettons of bit ftelcls


1t sedl to stose and datain a
man age
cempatt
Funtians!
Memar
Elags and Status
Repsesentation Enuas Valucs
Serialieation and Cormmunieattan.

Wha is meant an abstract data type?


's madhematiead mode 4hatfocus
0pesoions Can be porfozmec
atha than hothe implementeel
Adwanl
Adstsnages
tages
EXCretent
and 0isadantaqes of

Access
0 Memond
Sinmgle to EAGieieng
implenment
Zuitable fox Mothe matieal opemabton

fixeel size
6D Inettent Inseod'on/Deletion.
Contiqua us Mema regurement
Lack of Flesibilkt
Q.36 \Ahat An -amay
An Jecta stuctue
collec ton that stores
elements in a cont iquo us
block

\alha is an linked lst


A linked 1ist is a lineas date stouctue in
ohich elements, callecd nocdes Iinkeel
potnte.
Q-33lhed
Cs sing lin ked ltsks2
singl linked Iist lineas data ssuctuae
(ons isting Seguence of nodes
each node contains two paxts ohene
LoData value
ntoxmati'on tores in noce.
Nest A pointer orreference to the net nale
Page No.
Dats

Q39 Nhats cdoubl linkeck Jis1)


A doub lin ked 1i's+ linear doda
stuctue consis ting of nodes 6bere each
bode contains See paxts
o Data Naue tnfosmation stoes in node.
A NestApointesto nest node
60 Poeious A pointex to presious noce

Define double Jin ked l'st


A double circ des Ainlaed is t t's a variat'on
the doubly ltnked tst oheoe the
last hode's Next pointes points back o
the fist no de and the first node's
preiiousponter points buck the
lost node

What is the heed fox the headles


In data structue
heade node 's usel tu simplig
Cestatn operutons
Espertallg
empt
ohen
Ltsts
handling
the
edge cases
ftast nade.
Such

Deline lolynomtal ADT


A Polnamtal ADT
A date stuctube
used toepresent anck manipdate palynomiad
that bstact the
the unclexlyin
iple merntadton dehails
Page No

Hou searcb CAS elennent


Scarch
element
list using eithes lincar ScaTeh Gr binary
scaLhdepending
ar unsoted
on wheato
whe at o list s Soted

Define Dqueue
A Deg Dgue ue. stunds fos
Lt is aline ors date stuct ure
Double- Ended ueue
to he added
that alowes elenmenty
the ront remaed txom both erck
cncl eas

to implement
You Lan ingplement stack a using singl linked le.
stackusing
Singl linkecl lot by
the top of the stack maintaining
and p
ope'ans on the nkecd Jis entosminq puch
hat ore
ane the types of ineas inAed Iist
6Sinal linkec li'st
Doubl inked
Cirulas linkel ltst
hat
Sizeadantagesof Linkedl Jis
CAre

Daynarmic
5E4cient
No
Inseat'on and Deletion
alasted Spuce
Memo fEietenty fur laqe Dodaseds
to ibaglenent
Flesible Cornpk Data Shutue
Allocodion
Page No

GATte Joysn the algonithrn fos solsing Tovaes


of Han0i paablem ?
Moe 4he top n-1 cs ks fom the SOUTe

to t he
peg helper peg
nth disk frorm +he SourIe
( Awaxds, moste the
peq to the destinat'on peg
mote the res nl dtsks fxom
Einally +he desh'natiorn
helpesneg

You might also like