Python
#
Divide-and-conquer algorithm: Summation
#
Sum
#
General formula
#
Example
#
Divide-and-conquer
#
Iterative case
#
General formula
#
Example
#
Base case
#
Coding
def
find_sum
(
n
)
:
if
n
==
1
:
return
1
else
:
return
n
+
find_sum
(
n
-
1
)
print
(
find_sum
(
10
)
)
1
2
3
4
5
6
7
8
OUTPUT
55