Chapter 4 Decrease and Conquer Flashcards

1
Q

What is Topological Sorting

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Outline an algorithm to print a topological sort of a digraph or detect that the graph has a cycle. What will be the time and space complexity of your algorithm?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Consider the partition problem: Given n positive integers, partition them into
two disjoint subsets with the same sum of their elements. (Of course, the problem may not have a solution.) Design an exhaustive-search algorithm for this problem. You do not have to write pseudocode

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Discuss Khans Algorithm

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write pseudocode for the insertion sort algorithm. Also, discuss the time compleixty.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

write pseudocode for recursive binary search tree algorithm. Discuss the time complexity

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

write an algorithm to compute the product of two integers (russian peasant multiplication). Discuss the time complexity.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

write psuedocodee for euclids algorithm. Discuss the time complexity

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

write pseudocode to find the kth smallest element in a kist of n numbers. Discuss the time complexity.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

write pseudocode for Lomutos partitioning algorithm. Disucss the time complexity

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

write pseudocode for the quickselct algorithm. Discuss the time complexity.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly