Circular linked lists have either the head or the tail pointing to each other such that the list does not have a beginning nor an end (or rather the two coincide). It is possible to have a singly-linked circular list as well as, more commonly, a doubly circular linked list.

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

 % \node[on chain,draw,inner sep=6pt] (X) {\scriptsize\texttt{null}};
  \node[list,on chain] (A) {\nodepart{second} $a$};
  \node[list,on chain] (B) {\nodepart{second} $b$};
  \node[list,on chain] (C) {\nodepart{second} $c$};
  %\node[on chain,draw,inner sep=6pt] (D) {\scriptsize\texttt{null}};
  \path[*->] let \p1 = (A.three), \p2 = (A.center) in (\x1,\y2) edge [bend left] (B);
  \path[*->] let \p1 = (B.three), \p2 = (B.center) in (\x1,\y2) edge [bend left]  (C);
  %\draw[*->] let \p1 = (C.three), \p2 = (C.center) in (\x1,\y2) -- (D);
  \path[*->] let \p1 = (C.one), \p2 = (C.one) in (\x1,\y2)  edge [bend left] (B);
  \path[*->] let \p1 = (B.one), \p2 = (B.one) in (\x1,\y2)  edge [bend left] (A);
  \path[*->] let \p1 = (C.three), \p2 = (C.center) in (\x1,\y2) edge [in=100,out=100]  (A);
   \path[*->] let \p1 = (A.one), \p2 = (A.center) in (\x1,\y2) edge [in=-100,out=-100]  (C);

fuss/data_structures/circular_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.