Question 1

Time: 00:00:00
What type of sorting algorithm can be used to sort the random linked list with minimum time complexity?

Heap sort

Heap sort

Quick sort

Quick sort

Merge sort

Merge sort

Insertion Sort

Insertion Sort

Once you attempt the question then PrepInsta explanation will be displayed.

Question 2

Time: 00:00:00
Suppose a person sees a picture, so he slides the picture left and can see the next picture and when he wants to see the previous image so he slides picture right. So in viewing previous or next image, what type of data structure is used in it?

Stack

Stack

Queue

Queue

Tree

Tree

Once you attempt the question then PrepInsta explanation will be displayed.

Question 3

Time: 00:00:00
What is time complexity to count the number of elements of a linked list.

O(n)

O(n)

O(log n)

O(log n)

O(1)

O(1)

None of them

None of them

Once you attempt the question then PrepInsta explanation will be displayed.

#### PrepInsta User

it should be O(n) as it needs to travel to entire list

#### PrepInsta User

To count the number of elements, you have to traverse through the entire list, hence complexity is O(n).

#### PrepInsta User

For count, you have to travel all the link list so correct answer is O(n).

Question 4

Time: 00:00:00
what type of functionality the following code performs

Public void(Node node)

{

if(size==0)

else

{

Node temp,cur;

for(cur = head(temp=cur.getNext())! = Null; cur = temp);

cur.setNext(node);

}

size++;

}

Insertion from beginning

Insertion from beginning

Deletion from beginning

Deletion from beginning

Insertion from end

Insertion from end

Deletion from end

Deletion from end

Once you attempt the question then PrepInsta explanation will be displayed.

Question 5

Time: 00:00:00
What is the functionality of the following piece of code

Public int function(int data)

{

Int var=0;

while(temp!=Null)

{

if(temp.getData()==data)

Return var;

var=var+1;

Temp = temp.getNext();

}

Return Integer.Min_value;

}

Find the data

Find the data

Find the data and return position

Find the data and return position

Find the data and insert new element

Find the data and insert new element

Find the data and return data

Find the data and return data

Once you attempt the question then PrepInsta explanation will be displayed.

Question 6

Time: 00:00:00
Which of the following functionality is true for the count the number of the element of the link list.

A. public void insertBegin(Node node)
{
size++;
}

B. public void insertBegin(Node node)
{
size++;
}

C. public void insertBegin(Node node)
{
node.setNext(temp);
size++;
}

D. public void insertBegin(Node node)
{
node.setNext(temp);
size++;
}

A

A

B

B

C

C

D

D

Once you attempt the question then PrepInsta explanation will be displayed.

Question 7

Time: 00:00:00
There is a following code of simply link list. The code is for modifying the list by moving the last element to the front of the list. Some part of the code is left blank so choose a right statement for fill this blank.

typedef struct node

{

Int value;

Struct node *next;

}Node;

{

Node=*p,*q;

q=null;

while(p- >next == null)

{

q=p;

p=p- >next;

}

_______________________________

}

Once you attempt the question then PrepInsta explanation will be displayed.

Question 8

Time: 00:00:00

Forward and backward traversal within the list is permitted

Forward and backward traversal within the list is permitted

Nodes are arranged in hierarchical manner

Nodes are arranged in hierarchical manner

There is no beginning and no end

There is no beginning and no end

Compounds are all linked together in sequential manner.

Compounds are all linked together in sequential manner.

Once you attempt the question then PrepInsta explanation will be displayed.

Question 9

Time: 00:00:00
A link list contains minimum two field. One of them is data field to store the data so what is the second field?

It’s a pointer to character.

It’s a pointer to character.

It’s a pointer to integer.

It’s a pointer to integer.

It’s a pointer to node

It’s a pointer to node

None.

None.

Once you attempt the question then PrepInsta explanation will be displayed.

Question 10

Time: 00:00:00
The concatenation of two linked list takes O(1) time. Which of the following variation of linked list can be performed.

Once you attempt the question then PrepInsta explanation will be displayed.

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Buy TCS Prog. Logic (C MCQ) Paid Materials

Join TCS Online Classes

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

## One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assurance