About

A linked list is a data-structure based on a set of elements that together represent a sequence. Each node in the list points to the next element in the sequence such that the entire list can be traversed by following the links. Depending on how the elements are linked, there are various common subtypes of linked lists.


\begin{tikzpicture}[list/.style={rectangle split, rectangle split parts=2,
    draw, rectangle split horizontal}, >=stealth, start chain, square/.style={rectangle, draw}]

  \node[list,on chain] (A) {$a$};
  \node[list,on chain] (B) {$b$};
  \node[list,on chain] (C) {$c$};
  \node[list,on chain] (D) {$d$};
  \node[on chain,draw,inner sep=6pt] (E) {\scriptsize\texttt{null}};
  \draw[*->] let \p1 = (A.two), \p2 = (A.center) in (\x1,\y2) -- (B);
  \draw[*->] let \p1 = (B.two), \p2 = (B.center) in (\x1,\y2) -- (C);
  \draw[*->] let \p1 = (C.two), \p2 = (C.center) in (\x1,\y2) -- (D);
  \draw[*->] let \p1 = (D.two), \p2 = (D.center) in (\x1,\y2) -- (E);
  
  \node[square] (h) [below=of A] {\scriptsize\emph head};
  \node[square] (t) [below=of D] {\scriptsize\emph tail};
  
  \draw[->, dashed] (h) -- (A);
  \draw[->, dashed] (t) -- (D);
\end{tikzpicture}

Subtypes


fuss/data_structures/linked_lists.txt ยท Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.