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: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


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