Squaring n-bit int vs. multiplying two n-bit ints

前端 未结 6 650
南旧
南旧 2021-01-05 05:25

Disclaimer: Homework question. I\'m looking for a hint…

Professor F. Lake tells his class that it is asymptotically faster to square an n-bit integer than to multip

6条回答
  •  猫巷女王i
    2021-01-05 05:51

    Since you wanted only a hint, answer comes from this equation: (a + b)^2 = a^2 + b^2 + 2*a*b

    To not spoil the puzzle, I've posted complete solution separately :)

提交回复
热议问题