![](https://img-blog.csdnimg.cn/20190918140145169.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Algorithm
文章平均质量分 82
t
dénnnnnnnnnnn
这个作者很懒,什么都没留下…
展开
-
[GeneralAlgorithm] Binary Tree Algorithm 单链表算法 (in Python)
Binary Tree Algorithm (in Python)简易二叉树算法,包含可视化打印,附三类顺序表达和额外查找方法。最后一部分代码用以根据两种 data orders (inorder & preorder) 识别并创建Binary tree object.class BinaryTree: def __init__(self, rootElement): self.key = rootElement self.left = None原创 2020-12-01 12:59:12 · 151 阅读 · 0 评论 -
[GeneralAlgorithm] Stack Algorithm 栈算法 (in Python)
Stack Algorithm (in Python)栈算法,携Sample Test部分class Stack: def __init__(self): self.items = [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self):原创 2020-12-01 12:51:33 · 114 阅读 · 0 评论 -
[GeneralAlgorithm] Bounded Queue Algorithm 有界队列算法 (in Python)
Bounded Queue Algorithm (in Python)简易有界队列算法,携Sample Test部分class BoundedQueue: def __init__(self, capacity): assert isinstance(capacity, int), ('Error: Type error: {}'.format(type(capacity))) self.__items = [] self.__capacity原创 2020-12-01 12:35:46 · 180 阅读 · 0 评论 -
[GeneralAlgorithm] Circular Queue Algorithm 循环队列算法 (in Python)
Circular Queue Algorithm (in Python)简易循环队列算法class CircularQueue: def __init__(self, capacity): """ Constructor, which creates a new empty queue. """ # Check validity of capacity type and value if type(capacity)原创 2020-12-01 12:35:08 · 96 阅读 · 0 评论 -
[GeneralAlgorithm] Single-linked List Algorithm 单链表算法 (in Python)
Single-linked List Algorithm (in Python)简易单链表算法,携Sample Test部分class SLinkedListNode: def __init__(self, initData, initNext): self.data = initData self.next = initNext def getNext(self): return self.next def getData(s原创 2020-12-01 11:15:16 · 91 阅读 · 0 评论 -
[GeneralAlgorithm] Double-linked List Algorithm 双链表算法 (in Python)
Double-linked List Algorithm (in Python)简易双链表算法,部分功能待补充。class DLinkedListNode: def __init__(self, initData=None, initNext=None, initPrevious=None): self.data = initData self.next = initNext self.previous = initPrevious原创 2020-12-01 11:08:48 · 111 阅读 · 0 评论