Binary Multiplication Flashcards

1
Q

Up to what size number n can two integers be summed in a single CPU operation (O(1))?

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

what is the efficiency of the following:

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

What is the algorithm for binary multiplation using the grade school method.

Complete it and share the complexity

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

What is the naive algorithm for this base 10 number multiplication?

2715 * 6399

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

Perform the naive algorithm multiplation for these base 2 numbers:

0110 * 1101

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

What is the general multiplication for two n-bit integers

a * b

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

What is the Divide-and-conquer for general case of n-bit integers

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

How efficient is the following? What is the recursive formula?

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

Using master theorem, what is the speed of this algo:

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

What is the observation that leads to Karatsuba’s Multiplication algo?

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

What is the Divide, Conquer and Combine for Karatsuba’s mult algo?

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

What is the recursive formula for Karatsuba’s mult algo and what is it’s speed?

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

What are the algorithms that divide the size n into subproblems of approximately equal size?

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

What are the divide and conquer algos that divide the problem into subproblems of uneven sizes?

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

What is the divide,conquer and combine for quick sort?

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

What is the worst-case performance of QuickSort?

A
17
Q

What is the performance of best case quickSort?

A
18
Q

What are the different pivot choice implementations of QuickSort?

A
19
Q

What is the complexity of:

Summing/Multiplying two numbers, where n <= the number of bits in a word of memory?

Summing/Multiplying two numbers where n is > the number of bits in a word of memory?

A

If n <= the number of bits in a word of memory:

  • Both operations take one CPU cycle, O(1)

If n is > the number of bits in a word of memory:

  • Summing:
    • Theta of (n), where n is the num of columns
  • Multiplying:
    • Theta of (n2)