Time Left - 10:00 mins

Mission ISRO CS 2017 Exam: Algorithms Quiz-2

Attempt now to get your rank among 567 students!

Question 1

Consider the graph G in the following figure.

Suppose the nodes are stored in memory in an array Data as follows
DATA: x, y, z, w
Find the adjacency matrix A of the graph G

Question 2

Consider the following graph

Find the number of articulation points in the above graph?

Question 3

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statements are true?
i) 9679, 1989, 4199 hash to the same value
ii) 1471, 6171 has to the same value
iii) All elements hash to the same value
iv) Each element hashes to a different value

Question 4

In a permutation a1 ... an, of n distinct integers, an inversion is a pair (ai, aj) such that i < j and ai > aj.
If all permutations are equally likely, what is the expected number of inversions in a randomly chosen permutation of 1. . . n?

Question 5

In a permutation a1 ... an, of n distinct integers, an inversion is a pair (ai, aj) such that i < j and ai > aj.
What would be the worst case time complexity of the Insertion Sort algorithm, if the inputs are restricted to permutations of 1. . . n with at most n inversions?

Question 6

If one uses straight two – way merge sort algorithm to sort the following elements in ascending order : 20, 47,15,8, 9, 4, 40, 30, 12, 17, then the order of these elements after second pass of the algorithms is

Question 7

Consider the following sorting Algorithms.
I. Quicksort
II. Heapsort
III. Mergesort
Which of them perform in least time in the worst case?

Question 8

A hash table with 10 buckets with one slot per bucket is depicted in fig. The symbols, S1 and S7 are initially entered using a hashing function with linear probing. The maximum number of comparisons needed in searching an item that is not present is

Question 9

Consider a 13 element hash table for which f(key) = key mod 13 is used with integer keys. Assuming linear probing is used for collision resolution, at which location would the key 103 be inserted, if the keys 661, 182, 24 and 103 are inserted in that order?

Question 10

The physical location of a record determined by a formula that transforms a file key into a record location is
  • 567 attempts
  • 4 upvotes
  • 11 comments
Jul 5GATE & PSU CS