Search Header Logo

CTDL & GT

Authored by Hoàng Kiệt

Science

University

Used 9+ times

CTDL & GT
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the optimal time complexity to count the number of nodes in a linked list?

O(n)

O(1)

O(log n)

None of the above

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What will be the output of the following code snippet for the list 1->2->3->4->5->6?

1 2 3 4 5 6

1 3 5 5 3 1

1 3 5 1 3 5

2 4 6 1 3 5

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the following function do for a given Linked List with first node as head?

void fun1(struct node* head) { if(head == NULL) return; fun1(head->next); printf("%d ", head->data); }

Prints all nodes of linked lists

Prints all nodes of linked list in reverse order

Prints alternate nodes of Linked List

Prints alternate nodes in reverse order

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is

log 2 n

n/2

log 2 n – 1

n

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In Linked List implementation, a node carries information regarding

Data

Link

Data and Link

None of the mentioned

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which data structure allows deleting data elements from and inserting at rear?

Stacks

Queues

Dequeues

Binary search tree

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Stack is also called as

A First in first out

B First in last out

C Last in last out

D Last in first out

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?