Self Studies

Algorithms Test...

TIME LEFT -
  • Question 1
    2 / -0.33

    When using Dijkstra’s algorithm to find shortest path in a graph, which of the following statement is not true?

  • Question 2
    2 / -0.33

    What is recurrence for worst case of QuickSort and what is the time complexity in Worst case?

  • Question 3
    2 / -0.33

    Which of the following sorting algorithms in its typical implementation gives best performance when applied on an array which is sorted or almost sorted (maximum 1 or two elements are misplaced).

  • Question 4
    2 / -0.33

    What is the worst-case and average-case time complexity of the Binary search?

  • Question 5
    2 / -0.33

    Consider the below-given statement written in C language:

    int A = {25, 9, 15, 30, 11, 17 , 22}

    Bubble sort is applied on array A. Which element is present at index 2 after the second iteration?

  • Question 6
    2 / -0.33

    What is the time complexity for the below given block of code where i, j, n are integers and lines of code do contain any extra line space between them?

                    for(i = 0; i < n; i ++ )

                    for(j = m ; j > 0; j = j/2)

     printf(“Hello world” );

  • Question 7
    2 / -0.33

    Consider the following table:

     Algorithms

     Design Paradigms

     (A) Huffman Coding

     (I) Divide and Conquer

     (B) Merge sort

     (II) Greedy

     (C) Coin change problem

     (III) Dynamic Programming

     

    Match the algorithms to the design paradigms they are based on.

  • Question 8
    2 / -0.33

    Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this: 2 5 1 7 9 12 11 10 Which statement is correct?

  • Question 9
    2 / -0.33

    Consider a situation where swap operation is very costly. Which of the following sorting algorithms should be preferred so that the number of swap operations are minimized in general?

  • Question 10
    2 / -0.33

    If T(n) = 2T(n/2)+nlogn then T(n)?

  • Question 11
    2 / -0.33

    If G = (V,E) is a directed graph, then length of adjacency list is ______ and it requires ______ amount of memory.

  • Question 12
    2 / -0.33

    Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks like this: 16 14 15 10 12 27 28. How many heapify operations have been performed on root of heap?

  • Question 13
    2 / -0.33

    Consider 5 array of size 25, 31, 37, 49, 57 respectively. All arrays are sorted. All the arrays into a single array by using the optimal algorithm and the single array is again a sorted array. What is the maximum number of comparisons that will be needed in the worst case?

  • Question 14
    2 / -0.33

    What is the best time complexity of bubble sort?

  • Question 15
    2 / -0.33

    You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?

  • Question 16
    2 / -0.33

    Given an unsorted array. The array has this property that every element in array is at most k distance from its position in sorted array where k is a positive integer smaller than size of array. Which sorting algorithm can be easily modified for sorting this array and what is the obtainable time complexity?

  • Question 17
    2 / -0.33

    Which of the following is not a stable sorting algorithm in its typical implementation.

  • Question 18
    2 / -0.33

    Which of the following is not true about comparison based sorting algorithms?

  • Question 19
    2 / -0.33

    What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary search?

  • Question 20
    2 / -0.33

    Consider a hash table with 9 slots. The hash function is ℎ(k) = k mod 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, are

  • Question 21
    2 / -0.33

    Which sorting algorithm will take least time when all elements of input array are identical? Consider typical implementations of sorting algorithms.

  • Question 22
    2 / -0.33

    Consider a hypothetical system in which merge sort is implemented on an array of size of 2 bytes each. The size of the array is 2 MB. The maximum time taken by the merge sort to process the array is 256 seconds. What is the size of the input in MB of a problem that can be solved in 81.92 minutes?

  • Question 23
    2 / -0.33

    Consider two strings M = ”abababbaa” and N = ”babaa”.  The length of the longest common subsequence between two given string is r and the number of times the length of the longest common subsequence repeated in the matrix is n while using Dynamic programming. What is the value of r + r×n + n2 ?

    NOTE: Common subsequence may not necessarily be contiguous

  • Question 24
    2 / -0.33

    In quick sort, for sorting n elements, the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case time complexity of the quick sort?

  • Question 25
    2 / -0.33

    Consider the 10 Jobs for A to J. The execution of each job takes 1 unit of time. One job can be executed at a time. Each job is related with a profit and a deadline. If job is completed before deadline then the corresponding profit is earned. The maximum profit earned is _____.

    Job

    A

    B

    C

    D

    E

    F

    G

    H

    I

    J

    Profit

    25

    35

    40

    30

    18

    25

    33

    43

    19

    25

    Deadline

    4

    7

    4

    7

    1

    4

    6

    5

    3

    6

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 25

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
Submit Test
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now