上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example, given a 3-ary tree: 阅读全文
posted @ 2018-10-14 20:50 hopskin1 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positi 阅读全文
posted @ 2018-10-14 20:26 hopskin1 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 按序记录每棵树叶子节点。比较是否一致。 前序,中序,后序都可以。 Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequ 阅读全文
posted @ 2018-10-14 20:04 hopskin1 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Example 1: Input: ["a","b","c","a","c","c"]Output: 3Explanation: 3 groups ["a","a"], ["b"], ["c","c","c"]Example 2: Input: ["aa","bb","ab","ba&qu 阅读全文
posted @ 2018-10-14 19:43 hopskin1 阅读(307) 评论(0) 推荐(0) 编辑
摘要: Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2018-10-14 19:17 hopskin1 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 590. N-ary Tree Postorder Traversal Given an n-ary tree, return the postorder traversal of its nodes' values. For example, given a 3-ary tree: Return 阅读全文
posted @ 2018-10-10 01:27 hopskin1 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 700. Search in a Binary Search Tree Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node' 阅读全文
posted @ 2018-10-10 01:21 hopskin1 阅读(125) 评论(0) 推荐(0) 编辑
摘要: On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east. Here, the north-west corner of the grid is at the first row and c 阅读全文
posted @ 2018-10-10 01:04 hopskin1 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 经典链表题找链表的中间节点 快慢指针 #include #include #include using namespace std; //Definition for singly-linked list. //Given a non-empty, singly linked list with head node head, return a middle node of linked li... 阅读全文
posted @ 2018-10-09 23:40 hopskin1 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 答案: max(max(A)-min(A)-2*K,0) 代码: 阅读全文
posted @ 2018-10-09 08:03 hopskin1 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 12 下一页