lec1 (4)
lec1 (4)
(ADA-SEC A)
CSE222
6 1 2025
Administrivia
Lectures : 3:00 – 4:20 pm
Monday and Wednesday
Email : syamantak@.....
Instructor Team
TF : Renu (renu@..)
•
sstpxso
Evaluation
Tutorial Quizzes : (Best 8 x 2.5%) 20%
Mid-sem : 25%
End-sem : 25%
Evaluation
Tutorial Quizzes :
• Tutorial Sheets will be uploaded 5 days in advance
Zero-tolerance policy here. If I think you have adopted unfair means, I will
report without any conversation. Feel free to challenge through DAC !
Decorum
Check webpage for proper email etiquette
Schedule Tasks
One Algorithm – Many killer Apps
Have fun !
Multiplying Large Integers I
𝑎 𝑎 𝑎 ⋯⋯𝑎
𝑏 𝑏 𝑏 ⋯⋯𝑏
-------------------
a 5 6 7 8b
X1 2 3 4
c d
Mantra of an Algorithmist : Can we do differently ?
X1 2 3 4
c d
Mantra of an Algorithmist : Can we do differently ?
Write 𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝑎, 𝑏 , 𝑐, 𝑑 are n/2-digit integers
Then, 𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
Write 𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝑎, 𝑏 , 𝑐, 𝑑 are n/2-digit integers
Then, 𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
Write 𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝑎, 𝑏 , 𝑐, 𝑑 are n/2-digit integers
Then, 𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
Write 𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝑎, 𝑏 , 𝑐, 𝑑 are n/2-digit integers
Then, 𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
Write 𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝑎, 𝑏 , 𝑐, 𝑑 are n/2-digit integers
Then, 𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
Yet Another Recursive Algorithm
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑
𝐴 = 10 ⋅ 𝑎 + 𝑏 , 𝐵 = 10 ⋅ 𝑐 + 𝑑
𝐴 × 𝐵 = 10 𝑎𝑐 + 10 𝑎𝑑 + 𝑏𝑐 + 𝑏𝑑