Class
WHAT IS AN OBJECT? An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated. A class w...
WHAT IS AN OBJECT? An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated. A class w...
All containers are collections of objects All containers implement iterators, but they’re not all the same! All iterators implement a few shared operations: Initializing -> iter =...
Streams stream: an abstraction for input/output. Streams convert between data and the string representation of data. std::coutis an output stream .It has type std::ostream Two ways to classify s...
Generic Methods 例子 public static <K,V> V get(Map61B<K,V> map, K key) { if map.containsKey(key) { return map.get(key); } return null; } 在type未知的情况下引用Comparable,下面的e...
Uniform initialization curly bracket initialization. Available for all types, immediate initialization on declaration! 可以使用等号,也可以不使用 以下是例子: std::vector vec{1,3,5}; std::pair numSuffix1{1,"st"}; St...
Caveats of autoboxing and unboxing Arrays are never autoboxes or auto-unboxed, e.g. if you have an array of integers int[] x, and try to put its address into a variable of type Integer[], ...
Constructors Are Not Inherited 构造函数是不会继承的,若是子类调用父类构造函数,需要先加上super()函数(不加会默认用无变量的super()) Abstract classes Interface All methods must be public. All variables must be public static final. ...
## 第一种思路 步骤 添加一个连接点(属于Position类) 对每个连接点生成一个符合条件的模块(房间(Room)或走廊(Hallway)) 在该模块上添加更多的连接点 重新建立一个目前未连接的出口的列表 重复步骤2、3、4 注意:遍历连接点的方式会影响世界的连通效果 ...
a最近学到了查找技术这里,在学完折半查找情况下,也顺便学了下二分查找树。当然未来也肯定会学习B树的。 这里便以一道上机题目(是本学期最后的实验题哦,嘿嘿,第一个作对!) 还是有点坑点的,一些问题我会在相关代码处注释。 Description 随着互联网技术的飞速发展,如何从海量数据中查找所需内容,不仅是科研人员关注的热点问题,许多IT公司也先后推出了各自的搜索引擎,如:Google、...
最近学习Huffman树极其编码的相关知识,颇有收获。 毕竟有贵人相助嘛φ(゜▽゜*)♪ 话不多说,步入正题。 Basic Knowledge 针对Huffman树极其编码的基础知识,直接去看这个好了。 对于树的建立主要在于不断遍历寻找最小值以及次最小值,并通过循环不断更新与合并删除新的root 而对于编码的构成则可以通过递归来实现。 Example 这里举例一道例题 De...