TCS NQT Linked List Quiz – 1

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.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
Suppose a person see a picture, so he slides the picture left and can see next picture and when he wants to see 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

Linked list

Linked list

Tree

Tree

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

Please login to submit your explanation

Start

Question 3

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

O(1)

O(1)

O(log n)

O(log n)

O(n)

O(n)

None of them

None of them

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
In which functionality the following code will work.

Public void(Node node)

        {

            if(size==0)

            head==node;

            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.

Please login to submit your explanation

Start

Question 5

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

Public int function(int data)

    {

        Node temp = head;

        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.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Which of the following functionality is true for counting the number of elements of the linked list.

public int function(Node head) { int size=0; Node node=head; while(node != null) { size++; } return size; }

public int function(Node head) { int size=0; Node node=head; while(node != null) { size++; } return size; }

public int function(Node head) { int size=0; Node node=head; while(node != null) { Size++; node=node.getNext(); } return size; }

public int function(Node head) { int size=0; Node node=head; while(node != null) { Size++; node=node.getNext(); } return size; }

public int function(Node head) { int size=0; Node node=head; while(node != null) { size++; } size++; return size; }

public int function(Node head) { int size=0; Node node=head; while(node != null) { size++; } size++; return size; }

public int function(Node head) { int size=0; Node node=head; whilef(node != null) { Size++; node=node.getNext(); } size++; return size; }

public int function(Node head) { int size=0; Node node=head; whilef(node != null) { Size++; node=node.getNext(); } size++; return size; }

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

Please login to submit your explanation

Start

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 *function(Node *head)

{

    Node=*p,*q;

    if((head == null)||(head- >next==null))

        return head;

    q=null;

    p=head;

    while(p- >next == null)

    {

q=p;

p=p- >next;

    }

    _______________________________

    Return head;

}

q- >next=null; p- >next=head;head=p;

q- >next=null; p- >next=head;head=p;

head=p;p- >next=q; q- >next=null;

head=p;p- >next=q; q- >next=null;

q- >next=null; head=p; p- >next=head;

q- >next=null; head=p; p- >next=head;

q=null; p- >next=head;head=p;

q=null; p- >next=head;head=p;

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
In a circular link list

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.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
A link list contains minimum two field. One of them is data field to store the date so what about 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.

Please login to submit your explanation

Start

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.

Singly linked list.

Singly linked list.

Doubly linked list

Doubly linked list

Circular linked list

Circular linked list

Circular doubly linked list.

Circular doubly linked list.

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

Please login to submit your explanation

Start

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

Buy TCS NQT Paid Materials

Paid Materials TCS NQT

Join TCS NQT 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%

Completed

0/0

Accuracy

0%

Comments