- DS_Lab
- Oops and Ds Lab1
- Java Textual Simulation
- C++ Programming Lab
- Data Structure Material
- DATA STRUCTURE ASSIGNMENT
- data structure file
- qb2018_EEM303
- Computer Practical (C++ Programs) for CBSE XII Practical Exams
- Untitled
- Description
- CS3420_Lab3_writeup
- Lect 6
- java 5 programs
- D3804A15 ds 3
- structnotes
- Queue is an Abstract Data Structure
- NOI_2014
- student data base full pdf
- Autonomous Robotics by Nelson
- interview.docx
- Scs Maple Usage
- Interview Experience Campus-2016
- Quick Sort
- Anna Univ Syllabus for EIE 3rd to 8th Sem Syllabus -Www.annaunivedu.info
- Cases 99
- Assignments
- I&AE_Lab5_14MES1051
- CS214_2
- ct2
- Kirti Testing
- Testing 1
- Real 4
- Testing 4
- System Programing Solve 1
- System Software 3
- Real 1 Solution
- testing2 (1)
- rts 3
- system sw 4
- Testing 2
- sp123
- ritu
- s2
- RD3804A15
- It 4
- Graphics 4
- it 1 honrs
- It 1
- HW2_15
- Graphics 1
- java HW 3
- java 2 (2)
- D3804A15
- Java 4
- Java 1
- jiv testing2
- Graphics 8
- It 3
- Graphics 4 (1)

SUBMITTED BYGAURAV KAKKAR MCA REGD. 10804670 ROLL NO.- E3804_A23

Part-A 1. write algorithm to delete a given node in two way link list Ans. Delete the given node: • Forward[back[loc]]= forward[loc] And back[forward[loc]]=back[loc] • Send the deleted node to the avail list

• Forward[loc]=avail and avail=loc • Exit

THE PROCES IS THE FOLLOWING:

2. Discuss the Concept to insert an element in Link List at a given position And also implement that concept to insert ITEM=38 in the list at the location 3 where the list is as following: 46,39,48,49,58 Ans : In the one way list we simply assign the new node. And then we assign the link of new node to the next node of the location. And the link of the node of the before location to the new. Now the new node is inserted in between the two location.

• Set new=avail and avail=link[avail] • Info[new]=item=38 • If loc=NULL THEN [INSERT AS FIRST NODE]

o SET LINK[NEW]=START AND START=NEW • LINK [NEW]=LOC AND LINK [LOC]=NEW • EXIT 46,39,48,49,58

INSERTING ON THE 3RD LOCATION 463948 38 4958 LET THE C=38

3. Discuss the Concept to insert an element in Link List where the list is sorted . And also implement that concept to insert ITEM=45where the list is as following: 33,44,55,66,88,99 Ans .. For inserting the item in the sorted link list ,we have to find the location of the item. In the given question the item is the 45. And the location is the after 44 and the before the 55. So if we want to insert the item in the link list then we have to find the location firstly. . the item will inserted between the 44 and 55. For finding the location: • If Start=null then LOC=NULL and return • If ITEM<INFO[START],then set LOC=NULL and return • Set SAVE = START and PTR=LINK[START] • Repeat step 5 and 6 while PTR!=NULL • If ITEM<INFO[PTR], then: • Set LOC:=SAVE and return • SAVE=PTR and PTR=LINK[PTR] • Set LOC=SAVE • Return

After finding the element location then we insert the item on this location.. • IF AVAIL=NULL then write OVERFLOW and EXIT • SET NEW=AVAIL and AVAIL=LINK[AVAIL] • Set INFO[NEW]= ITEM • IF LOC=NULL then • Set LINK[NEW]=START and START=NEW • ELSE set LINK[NEW]=LINK[LOC] and LINK[LOC]=NEW • EXIT Both the two algorithm is used to insert the element in the sorted list… The item will inserted like the following procedure: 33,44, 45 ,55,66,88,99 4. How queues and stacks are represented in memory? Ans. Queue can also be represented in the memory using a linear array or a linear linked list. To start with , let us consider array representation of queue. Can represent the queue two type: • Array • Link list

Array: for array queue the two varable is required front and rear that holed the index of the first and the last element of the queue..

The memory is assign as follow: #define capacity 10 Struct { Int front,rear; Int element[capacity]; }queue; Queue q; From the above coding we can assign the array memory. And we can assign memory with the link list also.. The momory is declared as follow: Struct f { Int info; Struct f *next; {node; Struct { Node *front; Node *front; }queue; Stack in the memory: Like the queue we can represent the stack usin array and link list both. It work on the concept of the first come last out.. for this we need the variable named top that hold the index of the top element of the stack and an array to hold the element of the stack.. in stack the concept will implemented as: #define max 10 Struct { int top; Int element[max]; }stack; Stack s; A stack can be represented as the linked list also.. so it is called the linked stack. The array based repesention of stack suffers from following limitation. • Size must be known 5. Write algorithm to delete last node in circular linked list? Ans.: To delete any node in a circular linked list, you need a pointer to the Prior node, the Current node, and the Next node. If the list is not doubly linked, you don't need the pointer to the Prior node. You can get Prior and Next from Current (Current.prior and Current.next) or you

can walk the list looking for a node that points to Current. Then, set Prior.next = Next, Next.prior = Prior, and delete Current. If you have a single pointer to one of the nodes, and that node is being deleted, you will also need to update that pointer accordingly Part-B 6. Write algorithm to convert infix expression to prefix expression? Ans. We will represent simplification as a list of the rules ,much like the rules for student and eliza. But since each simplification rule is an algebraic equation ,we will storeeach one as an exp rather than a rule. We have choice as to how general we wat our infix notation to be. Consider: (((a*(x2))+(b*x))+c) (a*x2+b*x+c) (a x 2 + b x+c) A x2 +b*x+c The first is fully parenthesized infix, the seci=on makes use of the operator precedence and the third makes use of imlicit multiplication as well as operator precedence. The fourth requires a lexical analyzer to break lisp symbol into pieces.. 7. Write advantages and disadvantages of recursion.write various application and problem solving example that require the use of recursion? Ans. Advantage of the recursion: • The code may be much easier to write. • Some situations are naturally recursive Disadvantage of recursion: • There is shallow recursion and there is deep recursion. • Shallow recursion will not overflow the stack, but it may take an excessively long time to execute. • Deep recursion is generally much faster, but it may overflow the stack. Application in the factorial: function factorial( x ) { if x equals 0 then return 1 endif

return x * factorial( x-1 ) } 8. Write procedure to delete nth element from queue ? Ans:A data structure in which objects are added to one end, called the tail, and removed from the other, called the head (- a FIFO queue). The term can also refer to a LIFO queue or stack where these ends coincide. Algorithm:This procedure deletes an element from a queue and assigns it to the variable ITEM. 1. If FRONT :=NULL,then:Write: UNDERFLOW and return. 2. Set ITEM:=QUEUE[FRONT] 3. If FRONT:=REAR,then ; Set FRONT:=NULL and REAR:=NULL Else if FRONT:=N,then; Set FRONT:=1. Else : FRONT:=FRONT+1. 4.Return.

- DS_LabUploaded byanandreddyr
- Oops and Ds Lab1Uploaded bysamlenci
- Java Textual SimulationUploaded byjady9001
- C++ Programming LabUploaded byavrharinath
- Data Structure MaterialUploaded bygani525
- DATA STRUCTURE ASSIGNMENTUploaded byGaganpreet Singh
- data structure fileUploaded byvnsharma1992
- qb2018_EEM303Uploaded byShivam Gautam
- Computer Practical (C++ Programs) for CBSE XII Practical ExamsUploaded byShiladitya
- UntitledUploaded byRajContent
- DescriptionUploaded bynorthcat
- CS3420_Lab3_writeupUploaded byKevin Gao
- Lect 6Uploaded byapi-3705606
- java 5 programsUploaded byHafiz Mujadid Khalid
- D3804A15 ds 3Uploaded bySurendra Singh Chauhan
- structnotesUploaded byAnonymous IhmXvCHj3c
- Queue is an Abstract Data StructureUploaded bysuraj
- NOI_2014Uploaded bySudarshan Rao
- student data base full pdfUploaded byShiva Bandaru
- Autonomous Robotics by NelsonUploaded byNelson Khuraijam
- interview.docxUploaded byMukeshVerma
- Scs Maple UsageUploaded byDimas Bagus Cahyaningrat. W
- Interview Experience Campus-2016Uploaded byMayankLamba
- Quick SortUploaded byAparna Goli
- Anna Univ Syllabus for EIE 3rd to 8th Sem Syllabus -Www.annaunivedu.infoUploaded bysudentsidea
- Cases 99Uploaded by8148593856
- AssignmentsUploaded byKamal Nayan
- I&AE_Lab5_14MES1051Uploaded byYeswanth Golla
- CS214_2Uploaded byRavi Teja
- ct2Uploaded byPranjul Rastogi

- Kirti TestingUploaded bySurendra Singh Chauhan
- Testing 1Uploaded bySurendra Singh Chauhan
- Real 4Uploaded bySurendra Singh Chauhan
- Testing 4Uploaded bySurendra Singh Chauhan
- System Programing Solve 1Uploaded bySurendra Singh Chauhan
- System Software 3Uploaded bySurendra Singh Chauhan
- Real 1 SolutionUploaded bySurendra Singh Chauhan
- testing2 (1)Uploaded bySurendra Singh Chauhan
- rts 3Uploaded bySurendra Singh Chauhan
- system sw 4Uploaded bySurendra Singh Chauhan
- Testing 2Uploaded bySurendra Singh Chauhan
- sp123Uploaded bySurendra Singh Chauhan
- rituUploaded bySurendra Singh Chauhan
- s2Uploaded bySurendra Singh Chauhan
- RD3804A15Uploaded bySurendra Singh Chauhan
- It 4Uploaded bySurendra Singh Chauhan
- Graphics 4Uploaded bySurendra Singh Chauhan
- it 1 honrsUploaded bySurendra Singh Chauhan
- It 1Uploaded bySurendra Singh Chauhan
- HW2_15Uploaded bySurendra Singh Chauhan
- Graphics 1Uploaded bySurendra Singh Chauhan
- java HW 3Uploaded bySurendra Singh Chauhan
- java 2 (2)Uploaded bySurendra Singh Chauhan
- D3804A15Uploaded bySurendra Singh Chauhan
- Java 4Uploaded bySurendra Singh Chauhan
- Java 1Uploaded bySurendra Singh Chauhan
- jiv testing2Uploaded bySurendra Singh Chauhan
- Graphics 8Uploaded bySurendra Singh Chauhan
- It 3Uploaded bySurendra Singh Chauhan
- Graphics 4 (1)Uploaded bySurendra Singh Chauhan