Search Header Logo

LinkedListQuiz

Authored by Margaret Sitati

Computers

Professional Development

Used 1+ times

LinkedListQuiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

After the following loop terminates, reference p will be:

be null

refer to last node of the list

refer to second last node of the list

2.

MULTIPLE CHOICE QUESTION

1 min • 3 pts

After the following loop terminates, reference p will be?

p=head;

while(p.next != null){

if(p.next.value == x)

break;

p=p.next;

}

refer to node that contains value x

refer to predecessor of node that contains value x

refer to successor of node that contains value x

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To insert a new node in the beginning of a list, which of these statements have to be written?

temp.link = start; start =null;

temp.link=start;start = temp;

start.link = temp; temp=start;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a reference p refers to the last node, which of these statements should be written to insert a new node at the end of the list.

p.link=temp;

temp.link =p;

5.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

If a reference p refers to node P, then the following statements will insert a new node after node P.

temp.link = p.link;

p.link =temp;

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What should be there in place of the question mark to delete a node that is after the node referred to by reference p.

p.link = ?

null

p

p.link.link

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Media Image

What should be the loop condition in the following code so that list referred by start2 is concatenated at the end of list referred by start1.

p!=null

p.link != null

p.link.link !=null

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?