WeCP Algorithm Quiz 1

Question 1

Time: 00:00:00
What is the function that can directly convert a binary string s to an integer?

int(s,0,2)

int(s,0,2)

stoi(s,0,2)

stoi(s,0,2)

itoa(s,0,2)

itoa(s,0,2)

stoull(s,0,2)

stoull(s,0,2)

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 from  a given node I have to find how many connected components are there in a given graph. What is the way to find that out?

DFS

DFS

BFS

BFS

Both

Both

Topological sort

Topological sort

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

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
Heap sort is a sort using :

Stack memory

Stack memory

Stack data structure

Stack data structure

Heap memory

Heap memory

Priority queue

Priority queue

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
What is a randomised quick sort?

Selecting the pivot element randomly

Selecting the pivot element randomly

Starting from random index

Starting from random index

Changing the pivot number index into random index

Changing the pivot number index into random index

None of the above

None of the above

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 deletion time in an unordered_map with n values?

log(n) + Rebalance time

log(n) + Rebalance time

log(n)

log(n)

O(1)

O(1)

Cannot be determined

Cannot be determined

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 this is an implementation of a red black tree?

Hash Table

Hash Table

Map

Map

Unordered_map

Unordered_map

Vector

Vector

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

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
In a max flow problem what is called the source?

Centre Vertex

Centre Vertex

Vertex with the maximum weight

Vertex with the maximum weight

Vertex with zero incoming edges

Vertex with zero incoming edges

None of the above

None of the above

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
Which of the sorting algorithms does not use divide and conquer?

Selection sort

Selection sort

Merge Sort

Merge Sort

Quick Sort

Quick Sort

None of these

None of these

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Suppose you have some boxes, and the one box you open gives you the money that is equal to the weight of the box and the date of the month. In the start you have 30 boxes with given weight, and you have to maximise your profit. What is the best algorithm to implement?

Permutation

Permutation

Dynamic Programming

Dynamic Programming

Greedy

Greedy

Divide and Conquer

Divide and Conquer

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 shortest code inside a function to find how many digit are there in a number n:

while(n) s++,n/=10; return s;

while(n) s++,n/=10; return s;

while(n--) s++; return s;

while(n--) s++; return s;

Return to_string(n).length();

Return to_string(n).length();

len(n)

len(n)

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!"]

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/10

Accuracy

0%

Prime

Prime Mock

Complete Mock Subscription for WeCP

For WeCP
Get Prime Mock

Prime Video

Prime Video

Complete Video Course for WeCP

For WeCP
Prime Video
Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments