Question 1

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

O(n ^ 2)

O(n ^ 2)

O(nlogn)

O(nlogn)

O(n ^ 3)

O(n ^ 3)

O(n)

O(n)

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

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

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?

Ques 4. Hackerrank Quiz-1 Data structures

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

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

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

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?

Data structures ques 7- hackeerrank (quiz-1)

'0'

'0'

Runtime Error

Runtime Error

NULL

NULL

Garbage Value

Garbage Value

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

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)

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)

null
null

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

mute

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 Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments