Self Studies

Algorithms Test...

TIME LEFT -
  • Question 1
    2 / -0.33

    The following paradigm can be used to find the solution of the problem in minimum time:

    Given a set of non-negative integer, and a value K, determine if there is a subset of the given set with sum equal to K:

  • Question 2
    2 / -0.33

    What is the complexity of finding the 100th largest element in an already constructed binary max-heap?

    NOTE:
    Max-heap doesn't contain duplicate elements

  • Question 3
    2 / -0.33

    Let us consider that the capacity of the knapsack W = 55 and the list of provided items are shown in the following table. 

     

    1

    2

    3

    4

    5

    Profit

    100

    50

    150

    200

    130

    Weight

    25

    10

    20

    45

    15


    Find the maximum profit gain by applying fractional knapsack.

  • Question 4
    2 / -0.33

    What is the minimum number of comparisons required in an array to find the minimum and maximum of 202 integers?

  • Question 5
    2 / -0.33

    If Bubble sort is implemented to sort a collection of numbers on a singly linked list then which of the following statements are TRUE?

  • Question 6
    2 / -0.33

    Consider the following elements:

    15, 105, 37, 50, 63, 131, 8, 34, 205, 405, 5 and Hash table size = 13

    How many collisions occur when these key’s are first folded by adding their digits together and then reducing to mod hash table size.

  • Question 7
    2 / -0.33

    An array of 100 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is _________.

  • Question 8
    2 / -0.33

    Which is/are complexities of their corresponding algorithms?

  • Question 9
    2 / -0.33

    The recurrence equation T(n) = T(√n) + O(1) has the following asymptotic solution:

  • Question 10
    2 / -0.33

    Let the length of sorted arrays of X1, X2, X3, X4, and X be 70, 91, 79, 92, and 20 respectively. To merge them into a single array X by merging two arrays at a time using an optimal algorithm. In the worst case, the maximum number of comparisons needed is _____.

  • Question 11
    2 / -0.33

    If in best case quicksort is implemented for an input of size 1024 takes 80 seconds. How much time in seconds will require to process the input of size 524288?

  • Question 12
    2 / -0.33

    What is the most efficient algorithm that searches for a value in an m x n matrix. The matrix has the following properties:

    • Integers in each row are sorted from left to right.
    • The first integer of each row is greater than the last integer of the previous row.

  • Question 13
    2 / -0.33

    Consider the following set of tasks with their associated profits and deadlines, provided that 2 tasks can be completed in a unit time if the optimal schedule is able to get a profit of 128, then maximum value of ‘x’ possible is _____ .

    Task

    Profit

    Deadline

    1

    21

    5

    2

    12

    4

    3

    9

    1

    4

    7

    4

    5

    16

    3

    6

    14

    2

    7

    8

    5

    8

    6

    ‘x’

    9

    7

    2

    10

    17

    7

    11

    17

    1

    12

    5

    2

  • Question 14
    2 / -0.33

    Consider 4 matrics A, B, C, and D of dimensions 10 × 9, 9 × 12, 12 × 10, and 10 × 15, respectively. Which of the following is/are true about the number of scalar multiplications required to find the product ABCD using the basic matrix multiplication method? 

  • Question 15
    2 / -0.33

    Consider an array A of size 63, which consists of only 1’s or 0’s in it. In array A elements are arranged in ascending order. The maximum number of probes needed to find the minimum index j of A for which A[j] = 1 using optimal algorithm is _____.

  • Question 16
    2 / -0.33

    Consider the following C code segment int Ls Prime (n)

    {

    int i, n;

    for (i=2; i<= sqrt(n); i++)

    if (n % i == 0)

    {

    printf (“ Not Prime.\n”);

    return 0;

    }

    return 1;

    }

    Let T(n) denote the number of times the for loop is executed by the program on input n. Which of the following is true? 

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 16

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
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