mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-29 20:34:27 +01:00
Rename files
This commit is contained in:
parent
0624af6cb9
commit
c99c8ffb04
3 changed files with 2 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
class DoublyLinkedList
|
class DoublyLinkedList
|
||||||
# Initialize your data structure here.
|
# Initialize the data structure here.
|
||||||
attr_reader :head, :tail, :size
|
attr_reader :head, :tail, :size
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
@ -84,7 +84,6 @@ class DoublyLinkedList
|
||||||
cnt -= 1
|
cnt -= 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# else put "illegal input"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -126,7 +125,6 @@ class DoublyLinkedList
|
||||||
cnt -= 1
|
cnt -= 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# else put "illegal input"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Define a node in the list
|
# Define a node in the list
|
||||||
class Node
|
class Node
|
||||||
|
# Initialize the data structure here.
|
||||||
attr_accessor :value, :next
|
attr_accessor :value, :next
|
||||||
|
|
||||||
def initialize(value)
|
def initialize(value)
|
||||||
|
@ -9,7 +10,6 @@ class Node
|
||||||
end
|
end
|
||||||
|
|
||||||
# A Class for single linked lists (each element links to the next one, but not to the previous one)
|
# A Class for single linked lists (each element links to the next one, but not to the previous one)
|
||||||
|
|
||||||
class SinglyLinkedList
|
class SinglyLinkedList
|
||||||
include Enumerable
|
include Enumerable
|
||||||
attr_accessor :head
|
attr_accessor :head
|
Loading…
Add table
Reference in a new issue