Professional Documents
Culture Documents
Algo 2 08 Oct 2020 Thu 4pm 75
Algo 2 08 Oct 2020 Thu 4pm 75
(Practice Session – 2)
SATYA NARAYANA KAITEPALLI (SNK)
Consider a hash table that has 8 slots. If The Elements 127, 103,
Question No. 21 192, 257, 65, 73, 513, 313 has to be stored in the hash table using
linear probing. Then, The Element 313 will be stored in ______
Memory Slot.
A. 0 B. 7 C. 6 D. 1
Practice Session 2 – ALGORITHMS
Surveying
A. Linear Probing
B. Quadratic Probing
C. Double Hashing
D. Separate Chaining
Practice Session 2 – ALGORITHMS
Surveying
A. Linear Probing
B. Quadratic Probing
C. Double Hashing
D. Separate Chaining
Practice Session 2 – ALGORITHMS
Surveying
A. T(n) = 2T(n) + 1
B. T(n) = T(n/2) + 1
C. T(n) = 2T(n/2) + 1
D. T(n) = T(n) + 1
Practice Session 2 – ALGORITHMS
Surveying
A. 1.25
B. 0.8
C. 0.6
D. 1.5
Practice Session 2 – ALGORITHMS
Surveying
The Towers Of Hanoi problem with ‘n’ disks can be solved using
Question No. 30 _____ Steps.
A. 2n
B. n2
C. 2n-1
D. n2-1
Practice Session 2 – ALGORITHMS
Surveying
A. O(2n)
B. O(logn)
C. O(nlogn)
D. O(n)
Practice Session 2 – ALGORITHMS
Surveying
A. O(2n)
B. O(logn)
C. O(nlogn)
D. O(n)
Practice Session 2 – ALGORITHMS
Surveying
Question No. 33
A. Dynamic Programming
B. Divide and Conquer
C. Greedy Method
D. Branch and Bound
Dynamic Programming
Surveying
Applications of
Greedy Method ✓ ACTIVITY SELECTION PROBLEM
✓ JOB SEQUENCING PROBLEM
✓ HUFFMAN CODING
✓ FRACTIONAL KNAPSACK PROBLEM
✓ MINIMUM SPANNING TREE
✓ COIN CHANGE PROBLEM …
Surveying
Divide and Conquer
Applications Of
Branch and Bound ✓ 0/1 Knapsack Problem
✓ Job Scheduling with Deadlines Problem
✓ N Queen Problem
✓ Travelling Salesman Problem
✓ 8 Puzzle Problem …
Practice Session 2 – ALGORITHMS
Surveying
A. Dynamic Programming
B. Greedy Method
C. Branch and Bound
D. Backtracking
Practice Session 2 – ALGORITHMS
Surveying
The algorithm like Quick sort does not require extra memory for
Question No. 35 carrying out the sorting procedure. This technique is called
_______
A. in-place
B. stable
C. unstable
D. in-partition
Practice Session 2 – ALGORITHMS
Surveying
Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173,
Question No. 36 4199) and the hash function “x mod 10”, which of the following
statements are true?
A. i only B. ii only
C. i and ii only D. i and iii only
Practice Session 2 – ALGORITHMS
Surveying
Consider a hash table of size seven, with starting index zero, and a
Question No. 38 hash function (3x + 4)mod7. Assuming the hash table is initially
empty, which of the following is the contents of the table when the
sequence 1, 3, 8, 10 is inserted into the table using closed
hashing? Note that ‘_’ denotes an empty location in the table.
A. 8, _, _, _, _, _, 10
B. 1, 8, 10, _, _, _, 3
C. 1, _, _, _, _, _,3
D. 1, 10, 8, _, _, _, 3
Practice Session 2 – ALGORITHMS
Surveying
A. Dynamic programming
B. Greedy Method
C. Backtracking
D. Divide and Conquer
Practice Session 2 – ALGORITHMS
Surveying
Next Class
ALGORITHMS
(Practice Session - 3)