mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Create codespell.yml (#1698)
* fixup! Format Python code with psf/black push * Create codespell.yml * fixup! Format Python code with psf/black push
This commit is contained in:
@@ -3,7 +3,7 @@ Implementing Deque using DoublyLinkedList ...
|
||||
Operations:
|
||||
1. insertion in the front -> O(1)
|
||||
2. insertion in the end -> O(1)
|
||||
3. remove fron the front -> O(1)
|
||||
3. remove from the front -> O(1)
|
||||
4. remove from the end -> O(1)
|
||||
"""
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
- This is an example of a double ended, doubly linked list.
|
||||
- Each link references the next link and the previous one.
|
||||
- A Doubly Linked List (DLL) contains an extra pointer, typically called previous pointer, together with next pointer and data which are there in singly linked list.
|
||||
- Advantages over SLL - IT can be traversed in both forward and backward direction.,Delete operation is more efficent"""
|
||||
- Advantages over SLL - IT can be traversed in both forward and backward direction.,Delete operation is more efficient"""
|
||||
|
||||
|
||||
class LinkedList: # making main class named linked list
|
||||
|
||||
@@ -79,7 +79,7 @@ class LinkedList:
|
||||
# END represents end of the LinkedList
|
||||
return string_repr + "END"
|
||||
|
||||
# Indexing Support. Used to get a node at particaular position
|
||||
# Indexing Support. Used to get a node at particular position
|
||||
def __getitem__(self, index):
|
||||
current = self.head
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class LinkedList:
|
||||
def print_list(self):
|
||||
temp = self.head
|
||||
while temp is not None:
|
||||
print(temp.data, end=' ')
|
||||
print(temp.data, end=" ")
|
||||
temp = temp.next
|
||||
print()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user