careercup / CtCI-6th-Edition

Cracking the Coding Interview 6th Ed. Solutions
11.33k stars 4.41k forks source link

Asymptotically faster solution for `16.9` (Operations) #244

Open Qualtagh opened 1 year ago

Qualtagh commented 1 year ago

Hello! This is an attempt to supplement the solution of the task 16.9 with better asymptotics. The alternative approach is based on bit manipulations and is quite generic to be extended for any basic numeric operations. I hope that it may help somebody by showing new ideas.

The commit contains: