Add python code of chapter queue to docs.

This commit is contained in:
Yudong Jin
2022-12-02 00:09:34 +08:00
parent 460d42ae3d
commit e20bc251f5
18 changed files with 276 additions and 134 deletions

View File

@ -1,5 +1,6 @@
import copy
import math
import queue
import random
import functools
import collections

View File

@ -4,6 +4,8 @@ Created Time: 2021-12-11
Author: Krahets (krahets@163.com)
'''
import copy
import queue
from .binary_tree import TreeNode, tree_to_list
from .linked_list import ListNode, linked_list_to_list
@ -28,7 +30,6 @@ def print_linked_list(head):
arr = linked_list_to_list(head)
print(' -> '.join([str(a) for a in arr]))
class Trunk:
def __init__(self, prev=None, str=None):
self.prev = prev