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}
2020first element is \lstinline {x1}, the second \lstinline {x2}, etc. Iterative
2121process; time: $ O(n)$ , space: $ O(n)$ , since the constructed list data structure
2222consists 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
2427have 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}.
2832Iterative 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