documentation pass done, ready to use the HTML Checker in other code

This commit is contained in:
2025-11-03 15:20:41 -07:00
parent 4f9cdde1f2
commit 1ba02f37e9
7 changed files with 255 additions and 132 deletions
+7
View File
@@ -43,6 +43,7 @@ func (stk *Stack[T]) Peek() (T, bool) {
return stk.elements[len(stk.elements)-1], true
}
// RemoveMostRecent looks for the most recent particular data element on the stack, and removes that.
func (stk *Stack[T]) RemoveMostRecent(data T) bool {
i := len(stk.elements) - 1
for i >= 0 {
@@ -58,10 +59,16 @@ func (stk *Stack[T]) RemoveMostRecent(data T) bool {
}
return true
}
i--
}
return false
}
// Clear clears out the stack.
func (stk *Stack[T]) Clear() {
stk.elements = make([]T, 0)
}
// NewStack creates and returns a new stack.
func NewStack[T comparable]() *Stack[T] {
return &Stack[T]{