Self Studies

Algorithms Test...

TIME LEFT -
  • Question 1
    1 / -0

    Which of following problems cannot be solved using greedy approach?

  • Question 2
    1 / -0

    What is the efficient asymptotic running time to find the median of a two-sorted array after merging it?

  • Question 3
    1 / -0

    Recurrence relation for the time complexity of matrix multiplication using simple divide and conquer is:

  • Question 4
    1 / -0

    We are given 9 – tasks T1, T2, T3, T4,...... T9 . The execution of each task requires one unit of time. Each task Ti has a profit Pi and a deadline Di. You will get profit Pi if the task Ti is completed before the end of the deadline Di.

    Task

    T1

    T2

    T3

    T4

    T5

    T6

    T7

    T8

    T9

    Profit

    15

    20

    30

    18

    18

    10

    23

    16

    25

    Deadline

    7

    2

    5

    3

    4

    5

    2

    7

    3


    If maximum profit is earned then

  • Question 5
    1 / -0

    Consider an array nums in which there is only one duplicate number findDuplicate() returns that duplicate number. Arrays.sort(nums) sort the array nums and nums.length gives the length of array.

    Consider the below given block of code which is used   find the duplicate one.

    int findDuplicate(int nums[ ]) {
            int length = nums.length-1;
            if(length == 0)
                return 0;
            Arrays.sort(nums);
            for(int i=0; i<length; i++)
            {
                if(nums[i] == nums[i+1])
                    return nums[i];
            }
            return 0;   
    }

    Which algorithm design technique is followed in the above case to get the specified result?

  • Question 6
    1 / -0

    Let a one-dimensional array declare and initialize as int Array =  {1, 5,-6, 11, -2, -3, 6, -1, -2, 1, 4, 5, -3, 4, -2}

    The subsequence sum \(X\left( {m,n} \right) = \mathop \sum \nolimits_{x = m}^n Array\left[ x \right]\). Determine the maximum of X(m, n) where 0 ≤ m ≤ n < 15?

    NOTE: Use divide and Conquer Technique

  • Question 7
    1 / -0

    In a merge sort algorithm, the worst case takes 2048 seconds for an input size of 65536. What is the maximum input size of a problem that can be solved in 16 minutes (chose the close approximate answer)?

  • Question 8
    1 / -0

    Consider the table given below consisting of 5 items with their profit and weight associated with it.

    Items

    1

    2

    3

    4

    5

    Profit

    90

    130

    60

    110

    42

    Weight

    20

    60

    20

    50

    15

     

    The weight of the knapsack is 90. Find the maximum profit gain by applying fractional knapsack?

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
Submit Test
Selfstudy
Selfstudy
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