mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-26 21:16:07 +00:00
Add ru version (#1865)
* Add Russian docs site baseline * Add Russian localized codebase * Polish Russian code wording * Update ru code translation. * Update code translation and chapter covers. * Fix pythontutor extraction. * Add README and landing page. * placeholder of profiles * Use figures of English version * Remove chapter paperbook
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// File: recursion_test.go
|
||||
// Created Time: 2023-08-28
|
||||
// Author: Reanon (793584285@qq.com)
|
||||
|
||||
package chapter_computational_complexity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
/* Driver Code */
|
||||
func TestRecursion(t *testing.T) {
|
||||
n := 5
|
||||
res := recur(n)
|
||||
fmt.Println("\nРезультат суммирования в рекурсивной функции res = ", res)
|
||||
|
||||
res = forLoopRecur(n)
|
||||
fmt.Println("\nРезультат суммирования при имитации рекурсии итерацией res = ", res)
|
||||
|
||||
res = tailRecur(n, 0)
|
||||
fmt.Println("\nРезультат суммирования в хвостовой рекурсии res = ", res)
|
||||
|
||||
res = fib(n)
|
||||
fmt.Println("\nЧлен последовательности Фибоначчи с номером", n, "=", res)
|
||||
}
|
||||
Reference in New Issue
Block a user