mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-13 08:01:03 +01:00
Add quick test for SingleList
This commit is contained in:
parent
5ddb7345bf
commit
94bd130aad
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue