09 2018 档案

摘要:【概念】 封装又叫:information hiding blackboxing 好处:secure modify 减少依赖性 getter:查找object, setter:修改object eg 用户名自己可见,不用加 【static variable】 class-level,but can 阅读全文
posted @ 2018-09-28 10:34 苗妙苗 阅读(368) 评论(0) 推荐(0)
摘要:【买菜】 package Practice06; import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Scanner; import lab2.Ana 阅读全文
posted @ 2018-09-27 09:42 苗妙苗 阅读(126) 评论(0) 推荐(0)
摘要:【继承】 Java不支持多重继承 - 每个子类只有一个超类。 不是将成员变量声明为静态,更好的做法是将University实例化为对象,然后使用该对象访问其成员,如下所示: 【抽象类】 可以包含或者不包含具体的方法。不能实例化。 子类可以选择把父抽象类所有的抽象方法实例化,就不抽象了,然后可以被实例 阅读全文
posted @ 2018-09-18 20:51 苗妙苗 阅读(135) 评论(0) 推荐(0)
摘要:【CQ】 自增怎么样都增了,赋值不一定: a4 b6 c9 good evening,default也会默认输出:goodbye highest precision:Wrapper class BigDecimal BigInteger:有多长存多长 【SA】 可移植编程语​​言:编译一次,然后在U 阅读全文
posted @ 2018-09-18 10:56 苗妙苗 阅读(206) 评论(0) 推荐(0)
摘要:字符串括号匹配有效性: 要求从直接return改成了返回yes or no。需要添加到list后break,然后每次循环之前,boolean要重新初始化。 array index报错是什么鬼?算了,脑子不清楚,不改了。 字符串投票,返回票数最多的alpha顺序人名: map.put(vote, ma 阅读全文
posted @ 2018-09-16 21:08 苗妙苗 阅读(246) 评论(0) 推荐(0)
摘要:///yuec2 yue cheng package lab1; import java.util.Arrays; import java.util.Scanner; /**NameSorter class takes n number of names in the form of string 阅读全文
posted @ 2018-09-14 07:05 苗妙苗 阅读(250) 评论(0) 推荐(0)
摘要:记得截图没过的test case啊!否则连复习改bug的证据都没了啊!!! 其实也不一定非得要拿面试来测试,做做lc的contest,看看自己哪里不会,也是一样的效果。 注意是单选题还是多选题 hashmap单词查重:实在是简单啊,为啥就只过了一半? = 1 和 2 的情况都会取出来。本来想给map 阅读全文
posted @ 2018-09-09 23:24 苗妙苗 阅读(1778) 评论(0) 推荐(0)
摘要:[抄题]: Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values a 阅读全文
posted @ 2018-09-09 09:17 苗妙苗 阅读(359) 评论(0) 推荐(0)
摘要:[抄题]: You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains 阅读全文
posted @ 2018-09-09 08:16 苗妙苗 阅读(327) 评论(0) 推荐(0)
摘要:[抄题]: We are given a binary tree (with root node root), a target node, and an integer value K. Return a list of the values of all nodes that have a di 阅读全文
posted @ 2018-09-06 08:38 苗妙苗 阅读(162) 评论(0) 推荐(0)
摘要:[抄题]: You have a list of words and a pattern, and you want to know which words in words matches the pattern. A word matches the pattern if there exist 阅读全文
posted @ 2018-09-06 05:35 苗妙苗 阅读(396) 评论(0) 推荐(0)
摘要:[抄题]: Given a binary tree where every node has a unique value, and a target key k, find the value of the nearest leaf node to target k in the tree. He 阅读全文
posted @ 2018-09-05 23:08 苗妙苗 阅读(366) 评论(0) 推荐(0)
摘要:[抄题]: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空 阅读全文
posted @ 2018-09-05 04:56 苗妙苗 阅读(257) 评论(0) 推荐(0)