![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 76
北漂的阿狸
字节大数据开发在职,擅长Spark相关问题
展开
-
python数据结构第八章课后习题答案(三)
8.61 class Tree: """Abstract base class representing a tree structure.""" # ----------------------------nested Position class ----------------------------- class Position: """An abstraction representing the location of a single element原创 2020-09-15 20:15:42 · 518 阅读 · 0 评论 -
python数据结构第八章课后习题答案(二)
8.46 from typing import List, Any class Tree: """Abstract base class representing a tree structure.""" # ----------------------------nested Position class ----------------------------- class Position: """An abstraction representing t原创 2020-09-15 20:14:59 · 634 阅读 · 0 评论 -
python数据结构第八章课后习题答案(一)
再次更新 8.5 class Tree: """Abstract base class representing a tree structure.""" # ----------------------------nested Position class ----------------------------- class Position: """An abstraction representing the location of a single ele原创 2020-09-15 20:08:06 · 1291 阅读 · 0 评论 -
python数据结构第七章课后习题答案(二)
7.22 class Empty(Exception): pass class _DoublyLinkedBase: """A base class providing a doubly linked list representation.""" class _Node: """Lightweight,nonpublic class for storing a doubly linked node.""" __slots__ = "_eleme原创 2020-09-15 20:03:30 · 1170 阅读 · 0 评论 -
python数据结构第七章课后习题答案(一)
很抱歉代码没有及时更新,我决定以后会把自己的代码都分享出来 7.1 class Empty(Exception): pass class Linkstack: __slots__ = "_size", "_head" class _Node: __slots__ = "_element", "_next" def __init__(self, element, next): self._element = element原创 2020-09-15 20:01:58 · 2276 阅读 · 0 评论 -
python数据结构第六章课后习题答案
3 class Empty(Exception): """Error attempting to access an element from an empty container.""" pass class ArrayStack: """LIFO Stack implementation using a Python list as underlying storage.""" def __init__(self): """Create an emp原创 2020-06-03 14:21:15 · 2016 阅读 · 0 评论 -
python数据结构第五章课后习题答案
1 import sys data = list() n = 100 for k in range(n): a = len(data) b = sys.getsizeof(data) print("length :{0} Size in bytes: {1}".format(a,b)) data.append(None) 2 import sys data = list() n = 100 size = 63 for k in range(n): a = le原创 2020-05-18 18:52:42 · 3355 阅读 · 0 评论 -
python数据结构第四章课后习题答案
1 def find_max(data, index): if index == len(data)-1: return True max = find_max(data,index+1) if max > data[index]: return max else: return data[index] if __name__ == "__main__": data = [1, 2, 3, 4444, 5, 6原创 2020-05-18 18:44:44 · 3877 阅读 · 0 评论 -
python 数据结构第二章课后习题答案
4 class Flower: def __init__(self, name, account, price): self._name = str(name) self._account = int(account) self._price = float(price) def get_name(self): return self._name def get_account(self): retu原创 2020-05-18 18:30:14 · 2190 阅读 · 0 评论 -
python数据结构第一章课后习题答案
第一次创作 1 def is_multiple(n, m): if (not isinstance(n, int)) | (not isinstance(m, int)): raise TypeError('elements must be numeric') if n // m == n / m: return True else: ...原创 2020-04-13 22:35:27 · 1386 阅读 · 0 评论