26 solutions available
Question 1Assertion (A): The major implementation of using a data structure is to manage the storage of data in the memory efficiently.Reasoning (R):...
Question 2Assertion (A): While working with Stacks, the program should check for Overflow condition before executing push operation and, similarly,...
Question 5Assertion (A): Stack and Queue are linear data structures.Reasoning (R): List, tuples and dictionaries are Python built-in linear data...
Question 3Write applications of Stack.
Question 6Write an algorithm to pop an element from the Stack.
Question 7Write an interactive menu-driven program implementing Stack using list. The list is storing numeric data.Solutiondef push(num): h =...
Question 8Write an interactive menu-driven program to implement Stack using list. The list contains the names of students.Solutiondef push(student):...
Question 9How does FIFO describe queue?
Question 10Write a menu-driven Python program using queue to implement movement of shuttlecock in its box.Solutionqueue = [] def display_queue():...
Question 11Give the necessary declaration of a list implemented Stack containing float type numbers. Also, write a user-defined function to pop a...
Question 12A linear Stack called Directory contains the following information as contacts:— Pin code of city— Name of cityWrite add(Directory) and...
Question 13Write add(Books) and delete(Books) methods in Python to add Books and Remove Books considering them to act as append() and pop()...
Question 14Write AddClient(Client) and DeleteClient(Client) methods in Python to add a new client and delete a client from a list client name,...
Question 15Write Addscore(Game) and Delscore(Game) methods in Python to add new Score in the list of score in a game and remove a score from a list...
Question 16Write a Python program to sort a Stack in ascending order without using an additional Stack.Solutiondef pushSorted(s, num): if len(s) ==...
Question 17A Stack STK and Queue QUE is being maintained. Their maximum size is the same:(i) check whether they have the same size, i.e., have the...
Question 18(i)Write an algorithm to insert element into Stack as a list.
Question 18(ii)Write an algorithm to insert element into Queue as a list.
Question 19Write a program to create a Stack for storing only odd numbers out of all the numbers entered by the user. Display the content of the...
Question 20Write a program that, depending upon the user's choice, either adds or removes an element from a Stack.Solutiondef add(stack): h =...
Question 21Write a program that, depending upon the user's choice, either pushes or pops an element in a Stack. The elements are shifted towards the...
Question 22Write a program to insert or delete an element from a Queue depending upon the user's choice. The elements are not shifted after insertion...
Question 23Two lists Lname and Lage contain name of person and age of person respectively. A list named Lnameage is empty. Write functions as per...
Question 24A dictionary stu contains rollno and marks of students. Two empty lists stack_roll and stack_mark will be used as Stack. Two functions...
Question 25Write AddCustomer(Customer) and DeleteCustomer(Customer) methods in Python to add a new Customer and delete a Customer from a List of...
Question 4A queue behaves on the basis of LIFO principle.