title: Why are the nodes in my linked list graph going in reverse numerical order?
body: <p>I am trying to create an adjacency list with linked list operations and my graph edges are showing reverse numerical order and not in order. For example, my output is Node 0: 3 2 1 instead of Node 0: 1 2 3</p>
  <pre><code>class Node:
      def __init__(self, value):
          self.vertex = value
          self.next = None
  
  class AdjGraph:
      def __init__(self, data):
          self.data = data
          self.graph = [None] * self.data
  
      # Add edges
      def addEdge(self, vertice, edge):
          node = Node(edge)
          node.next = self.graph[vertice]
          self.graph[vertice] = node
  
      # Print the graph
      def printGraph(self):
          adj_list = &quot;Adjacency List&quot;
          for i in range(self.data):
              adj_list += &quot;\n\nNode &quot; + str(i) + &quot;: &quot;
              temp = self.graph[i]
              while temp:
                  adj_list += str(temp.vertex) + &quot; &quot;
                  temp = temp.next
          return adj_list
  </code></pre>