Skip to content

Commit 59dca41

Browse files
martin-henzremo5000
authored andcommitted
adds draw_list to the list library specs (#43)
1 parent bdedd50 commit 59dca41

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/source_lists.tex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ \subsection*{List Support}
2020
first element is \lstinline{x1}, the second \lstinline{x2}, etc. Iterative
2121
process; time: $O(n)$, space: $O(n)$, since the constructed list data structure
2222
consists of $n$ pairs, each of which takes up a constant amount of space.
23+
\item \lstinline{draw_list(x)}: Visualizes \lstinline{x} in a separate drawing
24+
area in the Source Academy using a box-and-pointer diagram; time, space:
25+
$O(n)$, where $n$ is the number of pairs in \lstinline{x}.
2326
\item \lstinline{equal(x1, x2)}: Returns \lstinline{true} if both
2427
have the same structure and the same numbers, boolean values, functions or empty list
25-
at corresponding leaf positions, and \lstinline{false} otherwise.
28+
at corresponding leaf positions, and \lstinline{false} otherwise; time, space:
29+
$O(n)$, where $n$ is the number of pairs in \lstinline{x}.
2630
\item \lstinline{length(xs)}: Returns the length of the list
2731
\lstinline{xs}.
2832
Iterative process; time: $O(n)$, space: $O(1)$, where $n$ is the length of \lstinline{xs}.

0 commit comments

Comments
 (0)