0% found this document useful (0 votes)
129 views12 pages

Important questions of dsa

These are the important questions for University exam for dsa

Uploaded by

ayushkumar32388
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
129 views12 pages

Important questions of dsa

These are the important questions for University exam for dsa

Uploaded by

ayushkumar32388
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 12
Seth Balkrishan Memorial Bhilai Institute of Technology,Durg (An Autonomous Institute affliated to CSVTU Bhila) Assignment - I Subject:Data Structures and Algorithms Student Name:_Sunidh? Nimje Roll No. :_5 Section: A Branch :Computer Science & Engineering Prof, Incharge Grade: Dr. Shweta Kharya Seth Battrishan Memorial Bhilai Institute of Technology, Durg (An Autonomous Insitute afiated to CSVTU Bhila) B. Tech. — 3™Semester Assignment-I Data Structures and Algorithms(102303CS) Cours Section- A and B Due Date of Submission:5-Nov-2024 Note 1) Attempt all questions 2) Answer each question tothe points and avd unnecessary lengthy writing. No. nest co | au] Fr | | Q.No Q | 1 | Ditferentiate linear and non-linear data structure. con | 12 | 14a con | 2 | 144 Explain Dynamic memory allocation. | algorithm to insert an element at the beginning of the single | Writ 3 | cor 13 | 141 | linked list. |_| Write an algorithm to delete an clement from end of the doubly eeu elene | inked tit us i i | 5 | Write an algorithm to add two polynomial cor | 13 | 141 j T | 6 | How the stack is implemented by linkedlist? coz | 2 |141 | | 7 | Convert infix expression A + (BYC-(D/E*F)*G)*H to its equivalent coz | us | 1 | postfix expression, of a ag _| Wetean algorithm to convert an infix expression into its equivalent prefix algorithm. come nets 9 | Explain double ended queue and its operations coz | ta | 14a jo _| Evaluate the following postfix expression: AB+C-BA+CA— where A=1,B~2and C=3. oa ae J CO ~ Course Outcomes BL ~ Bloom’s Taxonomy Levels (L1- Remembering, L2- Understanding, L3-Applying, 14- Analysis, L5- Evaluating, _.6-Creating), PI — Performance Inc (Please See: Ah fal jon! ‘Seth Balkrishan Memorial Bhilai Institute of Technology, Durg (An Autonomous Institute affiliated to CSVTU Bhilai) Questions: (com [pera Ener con | t2 | 141 Differentiate linear and non-linear data structure, lene Data staucture Non- Lingo Dara stacHi7e: | + Hiewachical 07 intexconneckd (eg 4700h, grap MA) > \pwrongoue nt : Sequential (eg-aw0yp Que wn > vurrple paths ¥ | Traversal ¢ ane by one, to a segue HO ee a j * , i > | Hewory allo akon’ Contiguous neva Won = contiguous we mony | it ef aliotaton | aoaton + | compleaity: simple op erapam (iner- ion andl cleb tion) fo1atiooship ¢ Eoch elu ent + Fleuentt way have wultiple = 3 Fock eto" elotinskips (parear ~ c hid» hao a chaect aelatenShip with 4he Prevow and next elownt « A | Aces Times Aon Hare 1S Jounaly foovensal wethadle ono +he tanstant on arms (01), ba smu ctune’s puight o7 depth (- linked! fists may have a(n) OCceH o (og) for binray. treet ao > + + to lowplex operliont interconnected noclor) F Accor Haw Vanier clopenchug, on] “Hwee - for grap fravensal | Insestion | deletiom’ Ingertion and % n4O1H00 dnd cleleH on Con be deletion an be hw - Condy Ku 706 efficient 10 Cortar'n 5 Fascloley in come (ase (e9- amas yequie Cog tree) but mending atlakie shiftikg element ) | Ships 1% r70xe Compleat: + | Examples? To-do lists, tine of it File uysteo Aoraichy (+202), People(quegue) steak buffer» — soctal mehvoak cormnecti or Gap) Seth Balkrishan Memorial Bhilai Institute of Technology,Durg (An Autonomous Institute affiliated to CSVTU Bhilai) }QN | ‘Questions co | BL] Pr 2__| Explain Dynamic Memory Allocation. coi | 12 | 141 ‘Ans : Dynamic Meuwy Alocatton? i+ sefeus 40 440 procou of atiocattn mamony cluntR the BUN4Me of a Progvom sa% opposed +6 static memory alfocaHion, whine He Mewory 45 aliocated at woupile Hue: | 1+ aulows pooysams to wquat ond Feleale wowonf as needed | while they are aunning 5 offering wow fexibity and efficent we’ | of wewu0 HY * Mewoy pllocation at Runtrue e Memory 3s allocates when +9 program sequeses fp oly ey ecuHimn © The enact amount of wevarr4 needed con bo cleterutnd at qurting »making i4 suitable for handling wanable-size data Stance s fike [inkeol lis, roe, or resizeable aways - Dy ngmtec Memory aujocakion Function en language» I?ko Cor C++ sguctons Ike matlocc> , atiocc », frent) ane wed to manage dynam mewony + y 3 Allon 0 spedfied Number of bytes but Me 5 Tavlocc) and => matoc (size doo not intHal'ze He manor: —> Cabloc( ums Ze) % Allacates momony Ae ot ony P eloueris and eptHtalize i+ +0 Zevor | > yeatloc (pia> new size) ¢ Rostzer +e allec ated menor (gallo ean 2 block > Jrol pre) * Re\eoo © \n nighon- vel Jong uog &% > like python ov Jara, mewo moanogowonl fs dona durowad ay watrg qrobag e collect * ay rhe previously, atocoted memory « | Seth Balkrishan Memorial Bhilai Institute of Technology, Durg (An Autonomous Institute affliated to CSVTU Bhilai) N ‘Questions CO Ps ‘Write an algorithm to insert an element at the beginning of the single linked list cor ans] 2 START tee ee att avail = NULL pant (“owsflow” ) f ext: Be sot New =avoil g aval! = raxt [avol I] 4s sot dataf New] = Trem 53 set Next new] = Stash > NULL 6S got ost =New | a spb > sta ot [+e™mp F406] Aaad < “4eweT tee se Sg s0 | <8] Ao] 29} 20] x] 5 |a4 ao mal 9310 ent] = nu 4 proceed 4444 § che tewpln A\ ‘Seth Balkrishan Memorial Bhilai Institute of Technology,Durg AG .d to CSVTU Bhilai) (An Autonomous Institute affiliate: on] ‘Questions co | Be | FF ly inked list. coi | us | 141 Waite an algorithm to delete an element from end of the dou? MesTART 2% dl stash = mp = back ent t ql dls stort 4tlf dd start [newt] corgi’ dls start = nu ¢ ie eu S free temp awit 4 + Repeat ste ° p 6 while tewpln s GS back =temp Sora 42 tewp = teu Crone] 22 4ewp [newk] = nuit 9% stop of +he sack all the Dpaatos © : teft Por See ei popped Our to posta exprenfon ¢ ( By) be Aisplayed to 3 Seth, Bhilai institute oe tT ‘Memorial fe of Autonomous insite apg OY, Du affiliated to csvtu, Bhilai) 5 plain double ended queveandioee ti [coz |} fans | Double-Ended Guere (o, Deque) ts a dota srmctane +hat allows Cowents +0 be cid ed and TRO Ved trom both the chon! ong wor ehda - This flenibity make ftuoye ben jatile +hon a RE WOL queu eas Sa} Chanobtenstrey § — © lt can function both aa Guoue CFIA) 4 a Sock (LIFO) © Element (an be imorta Grd clololed fro mdition ord © Deques can be /up lementeol Woing CVsmenYs + Linkeol lists « TYP® of Dopues i i Ub-Restoicked Depuoue § Invrtteo's attowed only abone end, tpuk Reseit fed De oO) mont on clelefiom can cw @t both endo dD Dele4i 00 ‘on is CaUowedl only a me end 2) OUEpUE Reotnited Deqy ee: Deletion i Pe) fa Ihoonion bu imeem can oun gr both the fT TTP Des or Operations sno Depue Pe aeias 21) Insert a Fant 2 ee an iiiont- per fae at the fant of 120 4 Pemoyor or @ Addl an elwen ab the poor leg wet on, 1b sorwway +h’ S nag be vey LU Ve 2 in an andy ‘wplewentote aft Ge © In anrcreay » : He ghpsing elurntt 14 there 1s chifting eluent +0 fil he inval Hi i “6 ‘ 9 aa “Lb i010 Ahi jf inal, tt simply wolves woul MN implesuen tH! » this involv 6 | 1 achuctng the heool pointer : ace heaol pointer to +h pen es sanyo ara queen 44 Peer cr ee 9 In on away, this Lan inyole mau ing the pear pointer Me Position back @ InaLl, tt way thvolve updaring HL +a’) pointer: \ Seth Baikrishay Bhilai Institute of in Memorial tite Technology, Durg 4G (An Autonomous Institute Affiliated to CSVTU Bhilai) co | BL pr coz} 14 [ua ton fe et Fix evaluation ts - 2 of post The value

You might also like