From 94bd130aad3253a55b1dafe9a9423b568a158dfa Mon Sep 17 00:00:00 2001 From: Vitor Oliveira Date: Sun, 7 Feb 2021 10:13:06 -0800 Subject: [PATCH] Add quick test for SingleList --- data_structures/linked_lists/single_list.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/data_structures/linked_lists/single_list.rb b/data_structures/linked_lists/single_list.rb index 955bf44..a4f84e6 100644 --- a/data_structures/linked_lists/single_list.rb +++ b/data_structures/linked_lists/single_list.rb @@ -74,3 +74,21 @@ class SingleList @head.nil? end end + +obj = SingleList.new + +obj.insert_head(1) +obj.insert_head(2) +obj.insert_head(3) +obj.insert_head(4) +obj.insert_head(5) +obj.print_list + +obj.insert_tail(6) +obj.print_list + +obj.delete_head +obj.print_list + +obj.delete_tail +obj.print_list