Source: View original notebook on GitHub
Category: Python / 2 Programs including Datastructure Python
import sys
sys.setrecursionlimit(11000)
from abc import abstractmethod,ABC
Linked List
No inbuilt-library is there but can use list = [] - python datastructure or can use collection.deque(): -by the way rarely used
Inbuilt - Stack
can use list= [] here as well
or can use :
LifoQueue of queue module
import queue
obj = queue.LifoQueue()
obj.put(1)
obj.put(12)
obj.put(13)
obj.put(5461)
obj.get()
Output:
5461
obj.get()
Output:
13
Queue
import queue
obj = queue.Queue()
obj.put(1)
obj.put(12)
obj.put(13)
obj.put(5461)
obj.get()
Output:
1
obj.get()
Output:
12
obj.get()
Output:
13
obj.get()
Output:
5461
obj.get??
