First commit

This commit is contained in:
2024-10-21 23:08:52 -04:00
commit 82b33f3c9a
6 changed files with 244 additions and 0 deletions

12
sliceQueue.go Normal file
View File

@@ -0,0 +1,12 @@
package main
// Helper functions for slices, to make them behave more like stacks
func peek[T any](s []T) T {
return s[len(s)-1]
}
func pop[T any](sp *[]T) T {
to_return := (*sp)[len(*sp)-1]
*sp = (*sp)[:len(*sp)-1]
return to_return
}