You are on page 1of 5

Heaps are used in many famous algorithms such as Dijkstra's algorithm for finding the

shortest path, the heap sort sorting algorithm, implementing priority queues, and more.
Essentially, heaps are the data structure you want to use when you want to be able to
access the maximum or minimum element very quickly.

 Quick Sort is useful for sorting arrays.


 In efficient implementations Quick Sort is not a stable sort, meaning that the relative
order of equal sort items is not preserved.
 Overall time complexity of Quick Sort is O(nLogn). ...
 The space complexity of Quick Sort is O(nLogn).

 Bubble Sort.
 Selection Sort.
 Merge Sort.
 Insertion Sort.
 Quick Sort.
 Heap Sort.

 Min Heap.
 Max heap.

structure is a collection of same or different data types.

defination of max heap-

Max heap is a specialized full binary tree in which every parent node contains greater or equal value
than its child nodes.

quick sort defination -

A sorting technique that sequences a list by continuously dividing the list into two parts and
moving the lower items to one

side and the higher items to the other. It starts by picking one item in the entire list to serve as a
pivot point.
Quick Sort is one of the different Sorting Technique which is based on the concept of Divide and
Conquer, just like merge sort.

But in quick sort all the heavy lifting(major work) is done while dividing the array into subarrays,
while in case of merge sort,

all the real work happens during merging the subarrays. In case of quick sort, the combine step does
absolutely nothing.

After selecting an element as pivot, which is the last index of the array in our case, we divide the
array for the first time.

In quick sort, we call this partitioning. It is not simple breaking down of array into 2 subarrays, but in
case of partitioning,

the array elements are so positioned that all the elements smaller than the pivot will be on the left
side of the pivot and all

the elements greater than the pivot will be on the right side of it.

And the pivot element will be at its final sorted position.

The elements to the left and right, may not be sorted.

Then we pick subarrays, elements on the left of pivot and elements on the right of pivot, and we
perform partitioning on

them by choosing a pivot in the subarrays.

A sorting technique that sequences a list by continuously dividing the list into two parts and moving
the lower items to one

side and the higher items to the other. It starts by picking one item in the entire list to serve as a
pivot point.

DSA quiz-9
2020wa15380@wilp.bits-pilani.ac.in Switch account
 
Your email will be recorded when you submit this form
* Required

Name *

Your answer

Bit-id *

Your answer

Section *
A
B
C
D

Dijkstra’s Algorithm is used to solve _____________ problems. *


1 point

All pair shortest path


Single source shortest path
Minimum spanning tree
Traversal methods

What is the running time of Bellman Ford Algorithm? *


1 point

O(V)
O(V2 )
O(E log V)
O(V*E)

Dijkstra’s Algorithm cannot be applied on ______________ *


1 point

Directed and weighted graphs


Graphs having negative weight function
Un-weighted graphs
Undirected and un-weighted graphs

Which is not a greedy approach? *


1 point

Bellman ford
Prims
Dijktra
All of the above

Which is pattern matching algorithm? *


1 point

Linear search
Brute Force Match
Binary search
Hoffman code

Which algorithm use adjacency matrix to find minimum spanning tree *


1 point

Kruskal
Prims
Dijktras
None of the above

……………..Algorithm is used find all pair shortest path *


1 point

Bellman ford
Dijktra
Floyd’s
Prims

The weighted directed graph has more than one edge with same values is possible
to have more than one spanning tree? *
1 point

Depends on graph
By prims only one
By kruskal more than one
Not possible by any approach

Applications of graphs are …….. *


1 point

Minimum spanning tree


Shortest path
All pair shortest path
All of the above

Horspool Algorithm is used for ....... *


1 point

Pattern Matching
Pattern searching
Patterncount
None of the above

Submit

Clear form
Never submit passwords through Google Forms.
This form was created inside of BITS Pilani University. Report Abuse
 Forms

You might also like