title: How do I alter a linked list inside of a hashmap?
body: <p>can you please advise me on how I can reach my list inside my map in order to alter it?</p>
  
  <p>For example,</p>
  
  <pre><code>Map&lt;Integer, LinkedList&lt;Integer&gt;&gt;() list= new HashMap&lt;Integer, LinkedList&lt;Integer&gt;)();
  </code></pre>
  
  <p>how would I add a value specifically to the linkedlist? I'm trying to create a graph from a 2d array map, so I want iterate through every point which is the integer, and I want to add the neighbors to the linked list. </p>
  
  <pre><code>Maps&lt;Integer(THIS IS THE SPOT, OR THE NODE), LinkedList&lt;Integer&gt;&gt;(THIS IS THE NEIGHBORS OF THE SPOT/NODE).
  </code></pre>
  
  <p>Any ideas? I know there's something like </p>
  
  <pre><code> list.get(list.values)
  </code></pre>
  
  <p>and I suppose it could work but I would have to get the values, adjust it, and then create a new Linked List so there's a lot of extra unnecessary steps, looking for a simpler way.</p>
  
  <p>If my map looked like this</p>
  
  <pre><code>         1 -&gt; 2 -&gt; 4 -&gt; 5
           2 -&gt; 3 -&gt; 7 -&gt; 5
           3 -&gt; 0 -&gt; 2 -&gt; 1
  </code></pre>
  
  <p>how would would I target the second node in the key 2, which is 7? </p>
  
  <p>Thank you in advance,  </p>