Data Structures
Linear
List
Python中list的实现[http://www.laurentluce.com/posts/python-list-implementation/] 和Java中是类似的.
Linked List
|
|
Stack
Stack is a Last In First Out (LIFO) linear data structure.
|
|
Ref: https://www.cs.cmu.edu/~adamchik/15-121/lectures/Stacks%20and%20Queues/Stacks%20and%20Queues.html
Queue
Queue is a First In First Out (FIFO) linear data structure.12345from collections import dequequeue = deque()queue.append(1)queue.append(2)queue.popleft()
Heap (Priority Queue)
Heapq module provides an implementation of the heap queue algorithm, also known as the priority queue algorithm.
Heaps are binary trees for which every parent node has a value less than or equal to any of its children.
|
|