摘要:
1. 抽象类和接口的区别: 抽象类是指不能被实例化的类,由abstract关键字修饰。 抽象方法是指没有方法体的方法,也就是一个空方法,是要被子类或扩展类来具体实现的方法。 接口是更抽象的抽象类,因为抽象类中允许存在非抽象方法(甚至可以一个抽象方法都没有),而接口中的所有方法均必须是抽象方法; 2. 阅读全文
摘要:
Question:A zero-indexed array A consisting of N integers is given. A triplet (P, Q, R) istriangularif 0 ≤ P A[R],A[Q] + A[R] > A[P],A[R] + A[P] > A[Q... 阅读全文
摘要:
Task descriptionA non-empty zero-indexed array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P avg && left < right - ... 阅读全文
摘要:
[LeetCode 52] N-Queens II|COMMENTSQuestionlinkFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of ... 阅读全文
摘要:
[LeetCode 179] Largest Number|COMMENTSQuestionlinkGiven a list of non negative integers, arrange them such that they form the largest number.For examp... 阅读全文
摘要:
QuestionlinkDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- ... 阅读全文
摘要:
QestionGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, (the... 阅读全文
摘要:
QuestionlinkImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will ret... 阅读全文
摘要:
QuestionlinkGiven a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to botto... 阅读全文
摘要:
Question:Count Complete Tree NodesTotal Accepted:11040Total Submissions:53992My SubmissionsQuestionSolutionGiven acompletebinary tree, count the numbe... 阅读全文