数据结构
文章平均质量分 76
北漂的阿狸
字节大数据开发在职,擅长Spark相关问题
展开
-
python数据结构第八章课后习题答案(三)
8.61class 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 · 515 阅读 · 0 评论 -
python数据结构第八章课后习题答案(二)
8.46from typing import List, Anyclass Tree: """Abstract base class representing a tree structure.""" # ----------------------------nested Position class ----------------------------- class Position: """An abstraction representing t原创 2020-09-15 20:14:59 · 588 阅读 · 0 评论 -
python数据结构第八章课后习题答案(一)
再次更新8.5class 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 · 1222 阅读 · 0 评论 -
python数据结构第七章课后习题答案(二)
7.22class Empty(Exception): passclass _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 · 1152 阅读 · 0 评论 -
python数据结构第七章课后习题答案(一)
很抱歉代码没有及时更新,我决定以后会把自己的代码都分享出来7.1class Empty(Exception): passclass Linkstack: __slots__ = "_size", "_head" class _Node: __slots__ = "_element", "_next" def __init__(self, element, next): self._element = element原创 2020-09-15 20:01:58 · 2238 阅读 · 0 评论 -
python数据结构第六章课后习题答案
3class Empty(Exception): """Error attempting to access an element from an empty container.""" passclass ArrayStack: """LIFO Stack implementation using a Python list as underlying storage.""" def __init__(self): """Create an emp原创 2020-06-03 14:21:15 · 1938 阅读 · 0 评论 -
python数据结构第五章课后习题答案
1import sysdata = list()n = 100for k in range(n): a = len(data) b = sys.getsizeof(data) print("length :{0} Size in bytes: {1}".format(a,b)) data.append(None)2import sysdata = list()n = 100size = 63for k in range(n): a = le原创 2020-05-18 18:52:42 · 3326 阅读 · 0 评论 -
python数据结构第四章课后习题答案
1def 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 · 3851 阅读 · 0 评论 -
python 数据结构第二章课后习题答案
4class 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 · 2183 阅读 · 0 评论 -
python数据结构第一章课后习题答案
第一次创作1def 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 · 1326 阅读 · 0 评论