What will be the status of the following list after the First, Second and Third pass of the insertion sort method used for arranging the following elements in descending order?
22, 24, 64,
34, 80, 43
Note: Show the status of all the elements after each pass very clearly underlining the changes.
For a given list of values in descending order, write a method in python to search for a value with the help of Binary Search method. The method should return the position of the value and should return -1 if the value not present in the list.
Write Insert(Place) and Delete(Place) methods in python to add Place and RemovePlace considering them to act as Insert and Delete operations of the data structure Queue.
class queue:
place = [ ]
def insert(self):
a = raw_input('Enter place')
queue.place.append(a)
def delete(self):
if (queue.place == [ ] ):
print('Queue empty')
else:
print('Deleted element is', queue.place[0])
queue.place.delete()
Write a method in python to find and display the prime numbers between 2 to N.Pass N as the argument to the method.
Evaluate the following postfix notation of expression. Show status of the stack after every operation.
22,11,/,14,10,,+,5,2
Write a statement in Python to perform the following operations:
Write a method in python to write multiple line of text contents into a text file myfile.txt line.
Consider the following definition of class Staff, write a method in python to search and display the content in a pickled file staff.dat, where Staff code is matching with ‘S0105’.
class Staff:
def __init__(self,S,SNM):
self.Staffcode=S
self.Name=SNM
def Show(self):
print(self.Staffcode,' ',
self.Name)
Observe the following STUDENTS and EVENTS tables carefully and write the name of the RDBMS operation which will be used to produce the output as shown in LIST? Also, find the Degree and Cardinality of the LIST.
STUDENTS
No | Name |
1 | Tara Mani |
2 | Jaya Sarkar |
3 | Tarini Trikha |
EVENTS
EVENTCODE | EVENTNAME |
1001 | Programming |
1002 | IT Quiz |
LIST
No | Name | EVENTCODE | EVENTNAME |
1 | Tara Mani | 1001 | Programming |
1 | Tara Mani | 1002 | IT Quiz |
2 | Jaya Sarkar | 1001 | Programming |
2 | Jaya Sarkar | 1002 | IT Quiz |
3 | Tarini Trikha | 1001 | Programming |
3 | Tarini Trikha | 1002 | IT Quiz |