Add notes for 2026.02.11
All checks were successful
Deploy to Homelab / deploy (push) Successful in 6s
All checks were successful
Deploy to Homelab / deploy (push) Successful in 6s
This commit is contained in:
24
shared/notes-and-examples/2026.02.11/main.py
Normal file
24
shared/notes-and-examples/2026.02.11/main.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
class Node:
|
||||||
|
prev_node = None
|
||||||
|
|
||||||
|
def __init__(self, value) -> None:
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
class Stack:
|
||||||
|
top: None | Node = None
|
||||||
|
|
||||||
|
def add(self, value):
|
||||||
|
# Implement as an exercise
|
||||||
|
pass
|
||||||
|
|
||||||
|
def remove(self) -> None | Node:
|
||||||
|
# Implement as an exercise
|
||||||
|
pass
|
||||||
|
|
||||||
|
def peek(self) -> None | Node:
|
||||||
|
# Implement as an exercise
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Homework:
|
||||||
|
# - Implement the other methods on the stack
|
||||||
|
# - Implement linked list methods (see homework from 2026.01.28)
|
||||||
Reference in New Issue
Block a user