Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/source_lists.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ \subsection*{List Support}
first element is \lstinline{x1}, the second \lstinline{x2}, etc. Iterative
process; time: $O(n)$, space: $O(n)$, since the constructed list data structure
consists of $n$ pairs, each of which takes up a constant amount of space.
\item \lstinline{draw_list(x)}: Visualizes \lstinline{x} in a separate drawing
area in the Source Academy using a box-and-pointer diagram; time, space:
$O(n)$, where $n$ is the number of pairs in \lstinline{x}.
\item \lstinline{equal(x1, x2)}: Returns \lstinline{true} if both
have the same structure and the same numbers, boolean values, functions or empty list
at corresponding leaf positions, and \lstinline{false} otherwise.
at corresponding leaf positions, and \lstinline{false} otherwise; time, space:
$O(n)$, where $n$ is the number of pairs in \lstinline{x}.
\item \lstinline{length(xs)}: Returns the length of the list
\lstinline{xs}.
Iterative process; time: $O(n)$, space: $O(1)$, where $n$ is the length of \lstinline{xs}.
Expand Down