最近在复习数据结构,发现这套题不错,题目质量好,覆盖广,Data Structures部分包括Example,以及简单,中等,难三个部分,这几天把Example的做完了, 摘要如下: 通过这几题让我复习和练习了优先队列,并查集,并查集的路径压缩. 总结如下: 11995 - I Can Guess the Data Structure! 给出push,pop操作对应的序列,判定是stack, queue还是deque. 用上面三个数据结构对应模拟下push,pop的操作,将结果与输出进行比对,需
Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The length of each part should be as equal as possible: no two parts should have a size differing by more than 1.
[抄题]: 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 distance K from the target node. The answer can be returned in any order. Example 1: Input: root = [3
这套题是叉姐出的,好难啊,先扫一遍好像没有会做的题了,仔细一想好像D最容易哎 Super Resolution Accepted : 112 Submit : 178 Time Limit : 1000 MS Memory Limit : 65536 KB Super Resolution Bobo has an n×m picture consists of black and white pixels. He loves the picture so he would like t