Class name Subject Book title Chapter number Content Created at
Class XII Computer Science Computer Science 3 only, usually referred to as TOP. • Stack follows LIFO principle using which an element inserted in the last will be the first one to be out. • PUS...
Class XII Computer Science Computer Science 3 process for matching parentheses using stack data structure. 5. Evaluate following postfix expressions while showing status of stack after each ope...
Class XII Computer Science Computer Science 4 t ha p er C 4 Queue “WecouldsaywewanttheWebtoreflect avisionoftheworldwhereeverythingisdone democratically.Todothat,wegetcomputers totalkwitheachot...
Class XII Computer Science Computer Science 4 numbers. If a confirmed ticket is cancelled, the W/ L1 numbered ticket is removed from the FRONT of the waiting queue and confirmed. • Sometimes on...
Class XII Computer Science Computer Science 4 these print students to check individual results. requests in a queue and sends them to the printer Can you suggest some one by one on a FIFO basis...
Class XII Computer Science Computer Science 4 index[n-1] as Operation performed Status of queue after operation Front and fix the enqueue(z) F Z R opposite end as Rear. enqueue(x) F Z X R enque...
Class XII Computer Science Computer Science 4 and returns the deleted element. The function first checks if the queue is empty or not, for successful deletion. def dequeue(myQueue): if not (isE...
Class XII Computer Science Computer Science 4 queue :P4 enter person’s code to enter in queue :P5 Now we are going to remove remaining people from the queue person removed from the queue is :p2...
Class XII Computer Science Computer Science 4 Activity 4.3 queue at the vacant booth. In a deque, if insertion Following are some examples where data structure and deletion of deque maybe appli...
Class XII Computer Science Computer Science 4 operation is used to remove one element at a time from the rear of the deque. 60 ComputerScience- ClasXII Reprint 2026-27 To perform above operatio...
Class XII Computer Science Computer Science 4 to be inserted in the beginning, we will use insert() with index 0 for it. def insertFront(myDeque, element): myDeque.insert(0,element) • A functio...
Class XII Computer Science Computer Science 4 return myDeque[len(myDeque)-1] else: print ("Queue underflow") def insertRear(myDeque,element): myDeque.append(element) def isEmpty(myDeque): if le...
Class XII Computer Science Computer Science 4 known as dequeue. • To support enqueue and dequeue operations, isEmpty, isfull and peek operations are used • Dequeisaversionofqueue,whichallowsins...
Class XII Computer Science Computer Science 5 a p t e r C h 5 Sorting “Everyoneoftoday'ssmartphoneshas thousandsoftimesmoreprocessingpower thanthecomputersthatguidedastronautsto themoon.” —Pete...
Class XII Computer Science Computer Science 5 of elements by repeatedly comparing the adjacent elements and swapping them if they are unordered. Swapping two elements means changing their posit...
Class XII Computer Science Computer Science 5 continues till the end of the list is reached. After the improvement in the Algorithm 5.1 so that first pass, the largest element will reach the en...
Class XII Computer Science Computer Science 5 i = 0 list in descending Step 2: WHILE i< n REPEAT STEPS 3 to 8 order? Step 3: SET j = 0 Step 4: WHILE j< n-i-1,REPEAT STEPS 5 to 7 Step 5: IF numL...
Class XII Computer Science Computer Science 5 further passes. In the second pass, the next smallest element is selected from the remaining elements in the unsorted list and swapped with the lef...
Class XII Computer Science Computer Science 5 list in ascending order. numList 8 7 13 1 -9 4 Index 0 1 2 3 4 5 Comparison in Pass 1 Comparison in Pass 2 No Change 8 7 13 1 -9 4 7 8 13 1 -9 4 Sw...
Class XII Computer Science Computer Science 5 i=i+1 76 C omputerScienc- ClassXII Reprint 2026-27 Program 5-3 Implementation of insertion sort using Python. def insertion_Sort(list3): n= len(lis...
Class XII Computer Science Computer Science 5 the scope of this textbook to discuss them in detail. However, we will discuss some basics of complexity to get some ideas. The following tips will...
Class XII Computer Science Computer Science 5 part of the sorted array. The process continues for the next element in the unsorted array till the list is sorted. • Insertion Sort places the ele...
Class XII Computer Science Computer Science 5 as an argument and calculates the ‘xth’ percentile (where x is any number between 0 and 100).You are required to perform the following steps to be ...
Class XII Computer Science Computer Science 6 a p t e r C h 6 Searching “Eventhoughmostpeoplewon'tbedirectly involvedwithprogramming,everyoneisaffected bycomputers,soaneducatedpersonshouldhave ...
Class XII Computer Science Computer Science 6 at the first element of the list and moving towards the last. Thus, it is also called sequential search or serial search. This technique is useful ...