\documentstyle[12pt,fullpage]{article}
%\textwidth 15cm
%\textheight 22cm
\topmargin -1cm
\oddsidemargin -0.2cm
\begin{document}
\parskip
\baselineskip
\bigskip
 
\begin{center}
{\Large {\bf Data Structures}}
\end{center}
\begin{center}
{\Large {\bf Exercise 2, part 2}}
\end{center}
{\bf Submition deadline: April 30}
\newline
\newline
Write a methods in Java language for the functions below.
\begin{enumerate}
\item $ReadGlist(L)$ as described in class.
\item $PrintGlist()$ as described in class. 
\item 
   $depth(L)$ - returns  $0$ if $L$ is atom or null; otherwise returns
              $1 + \max{depth(x_i)}$, where $x_i$ is element of $L$.
Example : $L= (a (b c ( d e ) ) ), depth(L)=3$.
 
\item $Copy(L)$ -  makes a copy of a generalized list $L$.
\item $Concat(L_1,L_2)$ : concatenate $L_1$ with $L_2$.
\begin{itemize} 
\item Do it leaving the result in $L_1$, without more memory (destroying $L_1$ )
\item Do it creating a new list, without changing $L_1$ or $L_2$.
\end{itemize} 
\item $Flatten(L)$ - scanning the list $L$.
\begin{itemize}
\item Do it leaving result  in $L$, without more memory.
\item Do not touch $L$, create a new list.
\end{itemize}
\end{enumerate}
\begin{center}
{\Huge {\bf Good Luck!}}
\end{center}
\end{document}
 
 


