Node-Based Data Structures


Exercises for Chapter #11 of A Common-Sense Guide To Data Structures and Algorithms

Get The Book!

Chapter Exercises


Exercise #1

Rewrite the index_of method using recursion instead of a while loop.

Exercise #2

Write a method that attaches two linked lists together.

Exercise #3

Write a method that reverses a linked list.

Exercise #4

Write a method that takes two linked lists and puts them together with a riffle shuffle. That is, if you riffle shuffle the following lists: [1, 3, 5, 7] and [2, 4, 6, 8], the resulting list should be [1, 2, 3, 4, 5, 6, 7, 8].

Let's Get In Touch!


Join the forum on The Pragmatic Programmers website to join in on the conversation about this book, or email Jay Wengrow, author of the book and this website directly.