Saving current work

master
Drew Bednar 3 months ago
parent e85b13e326
commit 630fe8ee45

@ -1,5 +1,6 @@
package datastructures
// Factorial a function that computes the factorial or a number. Big (n) time and space complexity. For loop could use less memory.
func Factorial(n int) int {
if n < 1 {
return 1
@ -7,3 +8,11 @@ func Factorial(n int) int {
return n * Factorial(n-1)
}
func Fib(n int) int {
if n < 1 {
return 1
}
return Fib(n-1) + Fib(n-2)
}

@ -0,0 +1,3 @@
module my_context
go 1.23.1
Loading…
Cancel
Save