about | help | code help+videos | done | prefs |
Give a recursive algorithm to compute the sum of the cubes of the first n positive integers. The input to the algorithm is a positive integer n. The output is sum(j=1,n,j^3). The algorithm should be recursive, it should not compute the sum using a closed form expression or an iterative loop. sumCubeRecursive(1) → 1 sumCubeRecursive(2) → 9 sumCubeRecursive(3) → 36 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 300
Copyright Nick Parlante 2017 - privacy