Prime

#### Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

#### Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

# HackerRank Data Structures Quiz -1

Question 1

Time: 00:00:00
What is the worst time complexity of mergesort?

O(n ^ 2)

O(n ^ 2)

O(nlogn)

O(nlogn)

O(n ^ 3)

O(n ^ 3)

O(n)

O(n)

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

Start

Question 2

Time: 00:00:00
What is the output of the following code?

Will print odd numbers

Will print odd numbers

Will print squares of natural numbers

Will print squares of natural numbers

Will print Fibonacci series

Will print Fibonacci series

Will print even numbers

Will print even numbers

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

Start

Question 3

Time: 00:00:00
What will be the position of the array after 2 iterations of insertion sort?
arr - {5,4,3,2,1}

1 2 3 4 5

1 2 3 4 5

2 3 4 5 1

2 3 4 5 1

3 4 5 2 1

3 4 5 2 1

4 5 3 2 1

4 5 3 2 1

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

Start

Question 4

Time: 00:00:00
A linked list 1 -> 2 -> 3 > 4. What will be the position of the linked list after the head of the linked list is passed to the function?

1 3 2 4

1 3 2 4

1 2 3 4

1 2 3 4

4 3 2 1

4 3 2 1

4 2 3 1

4 2 3 1

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

Start

Question 5

Time: 00:00:00
The following elements are inserted in a set - {1,8,9,2,3,2,3,4,5}.
After adding the elements in the set, the size function is called. What is the output of the size function?

9

9

8

8

7

7

6

6

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

Start

Question 6

Time: 00:00:00
Quicksort is applied to an array. The position of the array after the iteration is - 4 1 5 10 9 8. Which of the following statements is true?

4 is the pivot

4 is the pivot

10 is the pivot

10 is the pivot

1 is the pivot

1 is the pivot

5 is the pivot

5 is the pivot

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

Start

Question 7

Time: 00:00:00
The following linked list is given - 1 -> 2 -> 3. The head is at 1. What is the output of the following code?

'0'

'0'

Runtime Error

Runtime Error

NULL

NULL

Garbage Value

Garbage Value

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

Start

Question 8

Time: 00:00:00
What will be the position of the array after 2 iterations of bubble sort?
arr - {5,4,3,2,1}

1 2 3 4 5

1 2 3 4 5

4 3 2 1 5

4 3 2 1 5

3 2 1 4 5

3 2 1 4 5

2 1 3 4 5

2 1 3 4 5

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

Start

Question 9

Time: 00:00:00
Average Time Complexity of Quicksort with the first element as the pivot?

O(n ^ 2)

O(n ^ 2)

O(n)

O(n)

O(nlogn)

O(nlogn)

O(n ^ 2logn)

O(n ^ 2logn)

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

Start

Question 10

Time: 00:00:00
What is the avg time complexity of Binary Search?

O(n)

O(n)

O(n ^ 2)

O(n ^ 2)

O(nlogn)

O(nlogn)

O(logn)

O(logn)

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

Start

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

Completed

0/0

Accuracy

0%

Prime

#### Prime Mock

Complete Mock Subscription for HackerRank

For HackerRank
Get Prime Mock

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%