Sie sind auf Seite 1von 17

10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

The following function modifies the list by making the last element to the start
node of the list and returns the modified list. Write the missing code

q->NEXT= NULL; p->NEXT = head; head =p;

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 2/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Find the missing statement in the below code (inserting node at beginning)

head =newNode; head = Newnode;

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 3/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Find the output of the function for the linked list starting from 1 to 6

135531

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 4/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Consider a scenario that students are playing a game where all the players are
tied up by a rope in a circular fashion. Find the missing snippet if a player wants
to be inserted

Your answer

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 5/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Assume that you are creating a website in which you can traverse a page before
and after. Find the missing snippet to delete one of the pages

Your answer

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 6/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Let us assume that you are entering the student’s details in a class in a linked
fashion. Find the missing snippet to arrange the students by register numbers

Your answer

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 7/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Consider a linked list in which the last node points to the first node Find the
missing snippet for printing all the nodes.

Your answer

Consider there are n numbers in a list. Find the missing snippet to reverse the
linked list

head =prev;

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 8/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

What is the output of following function in which "start" pointing to the first node
of the following linked list? 4->5->6->7->8->9

468864

Fill in the blanks such that the following code returns the bottom most element
from the stack. struct node{ int data; struct node*next}*top; last inserted node(n)
always points to node which is inserted previous (n-1) node and n-1 node points
to n-2 node like wise...

temp->next!=NULL; temp = temp-> next; temp;

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 9/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

In an array implementation of stack, the stack is filled from the end of the
allocated memory. That is, if the size of array is 10, first element to be pushed
into the stack will be in arr[9], next element in arr[8] and so on. Fill in the blanks to
implement push and pop operations in such a scheme. Assume the edge cases
are handled by the main function.

Your answer

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 10/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

A queue is implemented using 2 stacks (Stack1 and Stack2). Initially, Enqueue


operation is done by pushing into Stack1. Dequeue operation is done by popping
elements from Stack1, pushing them into Stack2 and finally popping from Stack2.
If enqueuer has to be done again, elements are popped from Stack2, pushed into
Stack1 and finally the element is pushed into Stack1. Fill the blanks for enqueue
operation using push1(), push2(), pop1() and pop2() operations which are push
and pop operations of Stack1 and Stack2. Pop operations return top of stack
while popping.

pop2(); push1();

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 11/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Write a recursive function to implement division by repeated subtraction. The


function should return the quotient of 2 numbers x and y when they are divided.

x-y , y ;

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 12/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Consider the following code snippet. What is the maximum number of activation
records (including main())that will be held in the stack memory at any point in
time during the execution of the program?

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 13/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

A person arranged Covid-19 check up camp. For a day only MAX number of
people allowed for checkup. It is followed in First come First check order. Write
the necessary conditions

MAX==0; printf("Queue is Full"); return;

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 14/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Set of students playing ball passing game. Passing ball from one person to
another person. And there is MAXIMUM limit to join in group and play the game.
If group is full no one can join more. If anyone left from that group then that
place will be filled by outsider. Now you write the condition to check whether
group of people reaches maximum limit or not.

rear==size-1

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 15/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

Children at park playing “merry-go-round” and the operator want to see all the
children siting on this round. He wrote code for that. You too try that.

1)i=front;i<size; i++; 2)i=0; i<=rear; i++ 3) i=fro

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 16/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

A watch man at ticket counter allowing person one by one to take a ticket. To
easy his task Raju wrote a code for that. But he forgot some portions of code.
Help him to fill up.

Your answer

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 17/18
10/21/2020 CT2 18CSC201J -DSA(21-OCT-2020)

A group of students are asked to submit their notebooks to the teacher. The
class topper submits his notebook first. The rest of the students submit their
notebooks above that of the topper. The topper wants his notebook to be
checked first. So he pulls his notebook out and submits it on top of the notebook
stack. Complete the following code to implement the above scenario in a linked
list implementation of stack.

temp->next-> = top; top = temp-> next;

Page 3 of 3

Back Submit

Never submit passwords through Google Forms.

This form was created inside of SRM Institute of Science and Technology. Report Abuse

 Forms

https://docs.google.com/forms/d/e/1FAIpQLScvVvKcWgmRugaL6NebNUSZIbfkhEDjJ1WuJ09k-o01xrVfUg/formResponse 18/18

Das könnte Ihnen auch gefallen