title: Data structure for storing books using an array and a doubly linked list
body: <p>I am trying to create a data structure for a library program using an array and a linked list. The array's index represents the book ID and the element in the array represents the book quantity.</p>
  
  <p>To keep track of which borrowers has a copy of each book, I want each index pointing to a linked list.</p>
  
  <p>I already have the library files for the doubly (circular) linked list [clist].</p>
  
  <p>To create a new clist:</p>
  
  <pre><code>clist *xs;
  xs = new_clist();
  </code></pre>
  
  <p>The array for storing books is:</p>
  
  <pre><code>books[100]
  </code></pre>
  
  <p>Diagrammatically here is what i'm trying to do:</p>
  
  <pre><code> i (qty) -&gt; (list of borrowers)
  
   0  5    -&gt; (1,5,6)
   1  8    -&gt; ()
   2  6    -&gt; (8,5)
   .  .     .
   .  .     .
   .  .     .
   99 7     -&gt;(8,5,6)
  </code></pre>
  
  <p>I am struggling to program this data structure, I would be very grateful if somebody would show me how this could be done. Thank you in advance!</p>