summaryrefslogtreecommitdiff
path: root/packages/fcl-stl/doc/stack.tex
diff options
context:
space:
mode:
Diffstat (limited to 'packages/fcl-stl/doc/stack.tex')
-rw-r--r--packages/fcl-stl/doc/stack.tex39
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/fcl-stl/doc/stack.tex b/packages/fcl-stl/doc/stack.tex
new file mode 100644
index 0000000000..64d11f594c
--- /dev/null
+++ b/packages/fcl-stl/doc/stack.tex
@@ -0,0 +1,39 @@
+\chapter{TStack}
+
+Implements stack.
+
+Usage example:
+
+\lstinputlisting[language=Pascal]{stackexample.pp}
+
+Memory complexity:
+Since underlaying structure is TVector, memory complexity is same.
+
+Members list:
+
+\begin{longtable}{|m{10cm}|m{5cm}|}
+\hline
+Method & Complexity guarantees \\ \hline
+\multicolumn{2}{|m{15cm}|}{Description} \\ \hline\hline
+
+\verb!Create! & O(1) \\ \hline
+\multicolumn{2}{|m{15cm}|}{Constructor. Creates empty stack.} \\ \hline\hline
+
+\verb!function Size(): SizeUInt! & O(1) \\ \hline
+\multicolumn{2}{|m{15cm}|}{Returns number of elements in stack.} \\\hline\hline
+
+\verb!procedure Push(value: T)! & Amortized
+O(1), some operations might take O(N) time, when array needs to be reallocated, but sequence of N
+operations takes O(N) time \\ \hline
+\multicolumn{2}{|m{15cm}|}{Inserts element on the top of stack.} \\\hline\hline
+
+\verb!procedure Pop()! & O(1) \\\hline
+\multicolumn{2}{|m{15cm}|}{Removes element from the top of stack. If stack is empty does nothing.} \\\hline\hline
+
+\verb!function IsEmpty(): boolean! & O(1) \\ \hline
+\multicolumn{2}{|m{15cm}|}{Returns true when stack is empty} \\\hline\hline
+
+\verb!function Top: T! & O(1) \\\hline
+\multicolumn{2}{|m{15cm}|}{Returns top element from stack.} \\\hline
+
+\end{longtable}