CJCoding With Joseph
15free / daySign inCreate account

Data Structures & Algorithms

Adding Nodes With push_back()

Linked Lists

Now that we can add a node to the front using push_front(), let's implement push_back(), which inserts a node at the end of the linked list.

This requires us to find the last node in the linked list and then append it to that node's next pointer.

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 42 more lessons in Data Structures & Algorithms.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.