File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,13 @@ \subsection*{List Support}
20
20
first element is \lstinline {x1}, the second \lstinline {x2}, etc. Iterative
21
21
process; time: $ O(n)$ , space: $ O(n)$ , since the constructed list data structure
22
22
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}.
23
26
\item \lstinline {equal(x1, x2)}: Returns \lstinline {true} if both
24
27
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}.
26
30
\item \lstinline {length(xs)}: Returns the length of the list
27
31
\lstinline {xs}.
28
32
Iterative process; time: $ O(n)$ , space: $ O(1 )$ , where $ n$ is the length of \lstinline {xs}.
You can’t perform that action at this time.
0 commit comments