Skip to content

Commit d38c801

Browse files
committed
Update method to addToTail
1 parent cbd80d7 commit d38c801

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kotlin/Linked Lists/LRUCache.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class LRUCache {
3030
// re-add it to the tail of the linked list.
3131
val node = hashmap[key]!!
3232
removeNode(node)
33-
addNodeToTail(node)
33+
addToTail(node)
3434
return node.value
3535
}
3636

@@ -48,10 +48,10 @@ class LRUCache {
4848
hashmap.remove(head.next!!.key)
4949
removeNode(head.next!!)
5050
}
51-
addNodeToTail(node)
51+
addToTail(node)
5252
}
5353

54-
private fun addNodeToTail(node: DoublyLinkedListNode) {
54+
private fun addToTail(node: DoublyLinkedListNode) {
5555
val prevNode = tail.prev
5656
node.prev = prevNode
5757
node.next = tail

0 commit comments

Comments
 (0)