









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Algorithm, Traversal, C++ introduction, Event handling solving, Node all in one assignment
Typology: Exercises
1 / 15
This page cannot be seen from the preview
Don't miss anything!










Signature Date
CLOs CLO 1^ CLO 2^ CLO 3^ CLO 4^ CLO 5
Marks Awarded
Question 5 (4 Marks) [CLO 5]
1. Question1: A),B),C): Step1: Ask user to enter machine accuracy. Step2: Store machine accuracy in M_A. Step5: If TRUE then print “Average Feedback” else Print “Negative Feedback”.
3. Question 3: a) Linked List: a.a). Traversal: Step 1 : Check if START is not Null Step 2 : Set PTR = START Step 3 : While PTR - > Next != NULL VAL = PTR - > Data PTR = PTR - > Next [End of While] Step 4 : Exit
a.c) Insert Node: First Node: Step1: TempNode - > START Step2: START - > NewNode Step3: START-> Next = TempNode Step4: EXIT Between Nodes: Step1: ptr = START Step2: While ptr != NULL Step3: If ( ptr->Data == ’VAL’) then X=new node Read DATA(X); X->NEXT = ptr-> NEXT ptr->NEXT = X [End of if] Step4: ptr= ptr-> NEXT [End of while] 5.END. Last Node: Step1: Begin with Head Step2: While PTR != NULL If (PTR == NULL) PTR - > Next = A Else PTR = PTR - > NEXT END Of IF END of While Step3: EXIT
a.d) Delete Node: First Node: Step 1: PTR=START Step 2: START = START NEXT Step 3: FREE PTR Step 4: Exit Between Nodes: Step 1: PTR=START Step 2: While (PTR!=NULL) PREPTR=PTR PTR=PTR->NEXT If (PTR->DATA==VAL) PREPTR->NEXT = PTR->NEXT [End of IF] [End of While] Step 3: Exit Last Node: Step 1: PTR=START Step 2: While (PTR!=NULL) PREPTR=PTR PTR=PTRNEXT If (PTR==NULL) Set PREPTRNEXT=NULL FREE PTR End of If End of While Step 3: Exit
c) Queue: Insert: Step1: While (queue != MAX_SIZE ) If (queue == MAX_SIZE) Print “Queue is FULL” Else rear = rear + 1 queue[rear] = data [end of if] [end of while] Step2: Exit Delete: Step1: While (queue != empty) If (queue == empty) Print “Queue is empty” Else Data = queue[front] front = front + 1 [End of If] [End of While] Step2: Exit
!" #$%&'() !+*