feat: more algos

This commit is contained in:
mpaulson 2022-06-23 21:59:17 -06:00
parent 5a946a1f53
commit 5335cc10b0
16 changed files with 151 additions and 78 deletions

View file

@ -1,6 +1,6 @@
import Stack from "@code/Stack";
test("queue", function() {
test("stack", function() {
const list = new Stack<number>();
list.push(5);
@ -16,6 +16,14 @@ test("queue", function() {
expect(list.peek()).toEqual(5);
expect(list.pop()).toEqual(5);
expect(list.pop()).toEqual(undefined);
// just wanted to make sure that I could not blow up myself when i remove
// everything
list.push(69);
expect(list.peek()).toEqual(69);
expect(list.length).toEqual(1);
//yayaya
});