International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 101 - Number 15 |
Year of Publication: 2014 |
Authors: Rajat Tandon, Rajika Tandon |
10.5120/17761-8872 |
Rajat Tandon, Rajika Tandon . Algorithm to Compute Cubes of 1st “N” Natural Numbers using Single Multiplication per Iteration. International Journal of Computer Applications. 101, 15 ( September 2014), 6-9. DOI=10.5120/17761-8872
Different processors work with disparate speeds. For any given processor, elementary operations differ in terms of their speeds and computational complexities. The paper presents an algorithm to compute cubes of 1st "N" Natural Numbers using one multiplication by constant, two additions on variables and one addition by constant, per iteration. Theoretically, computational complexity of multiplication is O(n2) while that of addition is ?(n), where n is the number of bits used to represent that number. So, keeping the number of iterations same in both, in the traditional approach, the overall computational complexity per iteration is expressed in the order of O(n2) while in the current approach the overall computational complexity per iteration is of the order of O(n). For small values of "N", the difference in complexities may not be huge. But, given any large value of "N", difference will be noticeable.