Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
19 views
19 pages
DS Notes Unit 2
Some Notes
Uploaded by
devraikunal
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
Download now
Download
Save DS Notes Unit 2 For Later
Download
Save
Save DS Notes Unit 2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
19 views
19 pages
DS Notes Unit 2
Some Notes
Uploaded by
devraikunal
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
Download now
Download
Save DS Notes Unit 2 For Later
Carousel Previous
Carousel Next
Download
Save
Save DS Notes Unit 2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 19
Search
Fullscreen
UNIT-2 (Quoue & Linked let) Cue A queue 1 ar Dut G elements 2A which deletion cam J only at one end, called the Pent’ and unserhen can take place only at the otha endl, called thr“vear’, : Bu re abso called fystin first-out (FIO) baks ae ~ a FRONT, REAR, ITEM) adh ~ SF FRONT= 4 and REAR=N, Or At FRONT= REAR+/ then: iirite: OveRFlow, and Retin, 2 Chind new volus $ REALI SF FRonT: = NuiL, Hen: COueus. aunttall, emp I Set FRowT?24 and REAR=1 Else sf RERE = AI, than: ae REAR = 1 Ebe _ Set REa@= REAR-+'. 3. Set QVEVE Freme]'=TTEM Smet ingerte yuo como] 4. Retuyn . = a ee ~ COD ELETE [BYEVE, M, FRONT, xeae T7EM) 1. COs already Enigt, J ~ Sf FRONT = NPL, then: Waites UNDER FLOW andKelarn 2v Set TTEM: =QVEVET FRONT] 3. F¥ind 00d valu How 7 7 a value . ; , 3# FRONT!= eae aon Buus hag only One element] _ Set FRINT=NULL and REAP!~ NOLL Plse ud FRONTS then tan: Sue FRONT: = eM ERONT:= FRONTAL 4. Return. yee0, r — FIFO (fist.in Fst Ot) — Lbmuitr ure Stored : Varo Operation ) Quour Ove i S 2D Daoton DOurwr Onder flr» Y Delton - Dar = (Sear!) XK Goe front = (front 1) % sice.ioe uy jie er tsa Linear ist on uohih elemesd cam be Yemored at ethn end but at io ae A He term depee 4 a conbectir 1 a ea Moke’, = Dene Cratlar arrn a pomders LEFT & . 2 LEM =NUL Le jnrdical: Ahad o ed i : > Two variation ; y Ip xestricled Aesue. oN ty egal y 3 |__Tnaa]see ] 7 LEFTEY; RRB are Ree a_i Qiks Leet=F, RiGKT=2PRIORITY QuUEVES > A Prioils Buu a collicton &% elements such that each elements such eet each element hos been assis da priortly anal such that Hhe order in whith Vnysnl are Ahbed 7 proceed. come Hom ths. following aisle wD tn element higher” privity ds proeewed. a Lewsey prrow is (2 Two ehntit caith ue me Ss : procesced, according 2 the ereler in lohich Wig Were a hid crepresentttlion Sf leusé 2 Z demersioval array ee eS FRONT REAR gr" naa es 2 D{Bse ccc kK el 3 a 2 © Dov tee aC 4 | FFF a H 7 $ + SEER eats Py mtly Queue OVE UV Yd Le mallet k such Lhat FRONT EI FNL 2) Dell pd proces th. fort elzmtu in ve x Bueut 3) Ex atwrp * Dyyerlion « — yy Fusert Tt as the veay elomirt in-wo Queue - 2» Le[Add i607 useth Foi PiumBer =k (a) Traverse the onéscay hat vented Aading a rot - ae aor ae N. Trxert- INFOLS TARTI (2) Debt First rode fom Ah. Lat 3) Procem TTEM = 2 Exit. nePrnted Lol 7 a» wl 2 eis expen als. Abele oe OS oe Linear co, colton Ail. elo Called rode @bore the Lente erdter given by rte we eo node 6 dled tude stor parti Y Suge 24k peldoy raster preld. Cl a Bow Gi o Dip Et a ‘ ia \ sp ) aaa hea | 23 Cc al eit | ahs\eh i sto |J =LINKE: i 1) Sek PIR:= START Farshaloes porrter re] > cohil, PTR# Le, Ne £P#] * 4) Ket ol t= Linn [7 RI | Spent « Searching o Muded Luil Algeathn-senccy (16), SAR] LH, LO tet PRE € siner | 2) Repeak step 2 wohike pre xrvere i 3) If TIEME Ineo [PTL Hen’ Se Loc:= PIR & Exct 1 a fat PR = woe [rr] 4) Sef Loc:= wel 5) extt List U Sovtid ~ERCHSL (MFO, LIVESTART, 276M Lot? Y Cet PIR-ASTART Y) Repeats tep3 hi PIRE MULL DV pe Intel? 7k] ther PTR = LINE [PTET ye Se = Wee FD ; ‘=p7R& Le7t Set Loc!= AWLld & xt é 4) Set Loci= nie sy BatyMemory Allecalion oe = eee caith Lhe ae Oe TDi pera Logi cel, Trusfiat, vohith has oe: Ls cabled the Lat Parvibble ‘pute of the frer-stoege Lib or the ergo BED LINC — Ture is mo evaleble ace Arata Ths situthon is eed Le] AvAi= NOTE 7 a Underfleo scluati vohere ore ial bbl Boas cite sbuctine that v epi te)| insertion its 0 Mintel £40 wing be > Duet at, the beef ining ey NSPIRS T (INFO, LIVE, S7ART, WANE, TIECD y FE Avat= wil, Athen: Wore over fL08 F boot 2 Seer NEW! = AVAIL & Availe L)tk LAVOT D SE jbo [NEWT = TIEM 4) Se LINE INEwd = START 5) Set START = NEW 6) ext. > Inmet etter a gicon vacke INSLoc( NFS ANK, START AVA) va= nerd Ahen: bor iE OVER PLOWS EX Ge 4). 94, a 2) set NEW:= AVAIL WL, LOC » TED and Avalets LINK, TAVAE 3) Sat nfo [NEWT = LTE. 4) $f Loc neute thon: Set Else. “Cot Line [NEW =£ S) Exit Dainese? © OT ne£0 INKL LOD S LINK LL0e) EW > Drutng inte sell Ire Ss! - com tb be imeted ink a contd Lik Ut. Then limmit be Lnsoled Letwan nodes A 36 2 info 2 TEM = ino (8)(START Save PI INS SRT (VEO, LIVE, START, AVAL, 4) Call FINDA (1f0, LIVE, START, DIEM, zoo) 2) Call INSLOC( Mh, LIVE, START, Au AYL, Lol Ti) y Breil z FINDA [IN F0, LIVE, START, TTEM, Loc, 4) IF START = ULL thon Set Locus § Retlom 2) 9f TTEM< (Fo £4 ZART] than (et Loc: = ML & Return 3) Sot cavememe#n & PIR =Line Ls 7A 4p Repeat Saps 5% 6 while prep nee 5) 3f T7eM < 1000 LPTR] Ahm: Set Loc\= SAVE & Return. 6) Set SAvei= PTR & PTR= LINE Devel q) Set Loc:= SAVE 8) Return Deletion from a Linked Lote | DEL (iV E0, LINK, START, AWAIL, Loc, LocP) eee “tha Node nt with Locabre Lac. LICP | B® thé Lucation GF He rode which precedes IN 07 | cohen w is the iat wrote, Locp= ule | jay of Locp= Wil Athen! | Set START = LINE FeTAFTS / Ee: cs “cet LINK LlLo¢ T= LINK Ee0cd | + B gee we Pieg== Avale and AvaiL=Loc | ee ens oe) Ao© LINK S707 ~ CP Lod mai LINK [2ocp INK [Loc] DELETE AWwro, YINK | START, AVAIL, F 7é7) +) catl rinpg One, erate, SrA. 2) 4 Loca NULL kop torte: F104 po Diver 3) oF LOCP=WULL, then: ao START I= Liner CSTHET) estas 4 ‘ L LINE [LocP J. = Lig Lee) gO ef LINK [p0c) = AVAL & AVAILE LY’ 5) bxit. FINE (/NPO,LINE, START T1E04 Loe, L wp) Tin, Loc, 20) [40 OF STARTIZ NULL _Hin Set Loc'=wvl. 3 Locp!= wut X Klum 2) St INFOS TART = TI¢7 theo SCA Loci= s7pp7 2 LoeP=Nwee &ketun SD) Set Savers sre“. pip: = LINEBIRT] | Repeat steps 5% 6 while PTR Auvee /5) SF info EPTEI= TIEN, then; Set Loc= P7R & Locp:=SAVE & Reluw 6) Geb sAVEL= PTR & epee Linx Lee] ti Y SaF Loc: = AIL faearet ewig 3 §) ReturnHetty bunked List
- e PEAR Suh Lah 2. are. 2th. lim oy the lat 9 ation Ky A= €4,4 4, - there ws th Loely pe pote bite JF =. Means rs e =O mens ns ton ext Eeanpl f CR Gerwe Pieri Lute Berked hit — EB) a a7 Y, a) ‘ ob} eIETAI &) (lab, (od (a), (ay) aoe
You might also like
DSA assignment
PDF
No ratings yet
DSA assignment
18 pages
Unit 2
PDF
No ratings yet
Unit 2
30 pages
Singly linked list
PDF
No ratings yet
Singly linked list
9 pages
DSA chp-4 - English
PDF
No ratings yet
DSA chp-4 - English
21 pages
Chapter 2 (DS)
PDF
No ratings yet
Chapter 2 (DS)
50 pages
2nd Unit Ds 1st Yr
PDF
No ratings yet
2nd Unit Ds 1st Yr
23 pages
CS Practical - Compressed
PDF
No ratings yet
CS Practical - Compressed
27 pages
UNIT-4
PDF
No ratings yet
UNIT-4
24 pages
DS Complete Notes
PDF
No ratings yet
DS Complete Notes
67 pages
DSA Lab Sheet
PDF
No ratings yet
DSA Lab Sheet
33 pages
Ds Lab Program
PDF
No ratings yet
Ds Lab Program
78 pages
DS Assignment
PDF
No ratings yet
DS Assignment
16 pages
problem solving and python programming
PDF
No ratings yet
problem solving and python programming
34 pages
Kajal Soni IPE Data Structure
PDF
No ratings yet
Kajal Soni IPE Data Structure
17 pages
Dsa Assignment - 2002711
PDF
No ratings yet
Dsa Assignment - 2002711
6 pages
Linked List
PDF
No ratings yet
Linked List
59 pages
DSA Notes - Linked List - Anurag Bhattacharjee 22051925
PDF
No ratings yet
DSA Notes - Linked List - Anurag Bhattacharjee 22051925
64 pages
queue-adt
PDF
No ratings yet
queue-adt
34 pages
CamScan - 31 10 2023 - 17 50 10
PDF
No ratings yet
CamScan - 31 10 2023 - 17 50 10
10 pages
Data Structure
PDF
No ratings yet
Data Structure
16 pages
Data Structures
PDF
No ratings yet
Data Structures
85 pages
DS Notes Unit 1
PDF
No ratings yet
DS Notes Unit 1
32 pages
Data Structures using C (Complete Notes) - Srishty
PDF
No ratings yet
Data Structures using C (Complete Notes) - Srishty
84 pages
Linked List Class 04 Notes
PDF
No ratings yet
Linked List Class 04 Notes
29 pages
Unit1 Notes
PDF
No ratings yet
Unit1 Notes
36 pages
Dsa
PDF
No ratings yet
Dsa
143 pages
DSA Notes MAKAUT 3rd Sem
PDF
No ratings yet
DSA Notes MAKAUT 3rd Sem
13 pages
Ds-Linked lis
PDF
No ratings yet
Ds-Linked lis
50 pages
ITERATIVE APPROACH Complete pdf BTECH 1st year
PDF
No ratings yet
ITERATIVE APPROACH Complete pdf BTECH 1st year
66 pages
00_Linked_List_handwritten_notes
PDF
No ratings yet
00_Linked_List_handwritten_notes
22 pages
singly linked list
PDF
No ratings yet
singly linked list
9 pages
Dsa Assignment
PDF
No ratings yet
Dsa Assignment
14 pages
Dsa Short Notes
PDF
No ratings yet
Dsa Short Notes
37 pages
DSA 2019 Solution
PDF
No ratings yet
DSA 2019 Solution
34 pages
Data Structures ShortNotes
PDF
No ratings yet
Data Structures ShortNotes
15 pages
Dsfs Record
PDF
No ratings yet
Dsfs Record
114 pages
DAA Unit 4 Notes
PDF
No ratings yet
DAA Unit 4 Notes
34 pages
DSL 3 unit full
PDF
No ratings yet
DSL 3 unit full
25 pages
Design and Analysis of Algorithms 2
PDF
No ratings yet
Design and Analysis of Algorithms 2
13 pages
PDF Scanner-07_03_2025-04_36_47
PDF
No ratings yet
PDF Scanner-07_03_2025-04_36_47
48 pages
DSA Assignment
PDF
No ratings yet
DSA Assignment
22 pages
adsa-assignment3
PDF
No ratings yet
adsa-assignment3
14 pages
DSA Model QP-Soln 2023-24
PDF
No ratings yet
DSA Model QP-Soln 2023-24
34 pages
ds assignment 2
PDF
No ratings yet
ds assignment 2
15 pages
Dsa Exam
PDF
No ratings yet
Dsa Exam
6 pages
C Language Handwritten Notes With Sample Codes
PDF
No ratings yet
C Language Handwritten Notes With Sample Codes
103 pages
Class 12 CS Working With Functions
PDF
No ratings yet
Class 12 CS Working With Functions
47 pages
Data Structures Notes - 4499ec4e 7cde 4f0a b760 70a0ab99f63d
PDF
No ratings yet
Data Structures Notes - 4499ec4e 7cde 4f0a b760 70a0ab99f63d
110 pages
DS Linked List
PDF
No ratings yet
DS Linked List
17 pages
CLRS Gist - Handwritten
PDF
No ratings yet
CLRS Gist - Handwritten
32 pages
DSA notes
PDF
No ratings yet
DSA notes
12 pages
Dsa Unit 2 Notes
PDF
No ratings yet
Dsa Unit 2 Notes
35 pages
data structure 2
PDF
No ratings yet
data structure 2
50 pages
Dsa unit 1 aktu
PDF
No ratings yet
Dsa unit 1 aktu
5 pages
CS 12th short Notes
PDF
No ratings yet
CS 12th short Notes
13 pages
CD Unit 4 One Shot
PDF
No ratings yet
CD Unit 4 One Shot
15 pages
Data Structure Notes
PDF
No ratings yet
Data Structure Notes
22 pages
Os
PDF
No ratings yet
Os
38 pages
recording
PDF
No ratings yet
recording
48 pages