| Class XII |
Computer Science |
Computer Science |
6 |
the searching process ends. SearChing 85 Reprint 2026-27 If the middle element is greater than the key it means that if the key is present in the l... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
ha p t e r C 4 Queue “WecouldsaywewanttheWebtoreflect avisionoftheworldwhereeverythingisdone democratically.Todothat,wegetcomputers totalkwitheacho... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
get confirmed, as per the increasing order of waiting numbers. If a confirmed ticket is cancelled, the W/ L1 numbered ticket is removed from the FR... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
different computers students to check using a shared printer. The OS puts these print individual results. requests in a queue and sends them to the... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
the right. fix either of the ends index[0] or index[n-1] as Operation performed Status of queue after operation Front and fix the opposite end as e... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
It has one parameter - name of the queue and returns the deleted element. The function first checks if the queue is empty or not, for successful de... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
from the front of the deque. • DELETIONREAR: This operation is used to remove one element at a time from the rear of the deque. 60 Computer SCienCe... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
and element to be inserted. As the element is to be inserted in the beginning, we will use insert() with index 0 for it. def insertFront(myDeque, e... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
return myDeque[0] else: print("Queue underflow") def getRear(myDeque): if not (isEmpty(myDeque)): return myDeque[len(myDeque)-1] else: print ("Queu... |
|
| Class XII |
Computer Science |
Computer Science |
4 |
Insertion operation is known as enqueue and deletion operation is known as dequeue. • To support enqueue and dequeue operations, isEmpty, isfull an... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
a p te C h r 5 Sorting “Everyoneoftoday'ssmartphoneshas thousandsoftimesmoreprocessingpower thanthecomputersthatguidedastronautsto themoon.” —Peter... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
sorts a given list of elements by repeatedly comparing the adjacent elements and swapping them if they are unordered. Swapping two elements means c... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
think of making any continues till the end of the list is reached. After the improvement in the Algorithm 5.1 so that first pass, the largest eleme... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
a Step 1: SET 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 S... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
not considered in further passes. In the second pass, the next smallest element is selected from the remaining elements in the unsorted list and sw... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
Comparison in Pass 5 -9 1 4 7 8 13 Indicates the smaller element in a comparisson Indicates the elements in the sorted list -9 1 4 7 8 13 Sorted Li... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
list is :") for i in range(len(numList)): print (numList[i], end=" ") Output: The sorted list is : -9 1 4 7 8 13 5.4 InsertIon sort Insertion sort ... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
to arrange a 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... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
Step 9: set i=i+1 76 C omputerSCienC- ClaSSXii Reprint 2026-27 Program 5-3 Implementation of insertion sort using Python. def insertion_Sort(list3)... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
it is beyond the scope of this textbook to discuss them in detail. However, we will discuss some basics of complexity to get some ideas. The follow... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
becomes a n oteS part of the sorted array. The process continues for the next element in the unsorted array till the list is sorted. • Insertion So... |
|
| Class XII |
Computer Science |
Computer Science |
5 |
list of marks as an argument and calculates the ‘xt’ percentile (where x is any number between 0 and 100).You are required to perform the following... |
|
| Class XII |
Computer Science |
Computer Science |
6 |
p t e ha r C 6 Searching “Eventhoughmostpeoplewon'tbedirectly involvedwithprogramming,everyoneisaffected bycomputers,soaneducatedpersonshouldhave a... |
|
| Class XII |
Computer Science |
Computer Science |
6 |
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 for... |
|
| Class XII |
Computer Science |
Computer Science |
6 |
display ‘Element found at position 4’. Let us now assume another arrangement of the elements in numList as [17, 8, -4, 7, 0, 2, 19] and search for ... |
|