上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 77 下一页
摘要: [抄题]: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i 阅读全文
posted @ 2018-03-18 21:51 苗妙苗 阅读(209) 评论(0) 推荐(0)
摘要: [抄题]: Write a function to find the longest common prefix string amongst an array of strings. 在 "ABCD" "ABEF" 和 "ACEF" 中, LCP 为 "A" 在 "ABCDEFG", "ABCEF 阅读全文
posted @ 2018-03-18 19:55 苗妙苗 阅读(163) 评论(0) 推荐(0)
摘要: [抄题]: Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If th 阅读全文
posted @ 2018-03-18 10:43 苗妙苗 阅读(243) 评论(0) 推荐(0)
摘要: [抄题]: [暴力解法]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 还停留在 i < len / 2的阶段,不行,应该是指针对撞问题了 [一句话思路]: 先要把字符串转成数组,再转回来,数据结构白学了? [输入量]:空: 正常情况:特大:特小:程 阅读全文
posted @ 2018-03-18 10:01 苗妙苗 阅读(143) 评论(0) 推荐(0)
摘要: [抄题]: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly twoor zero sub-n 阅读全文
posted @ 2018-03-18 08:39 苗妙苗 阅读(194) 评论(0) 推荐(0)
摘要: [抄题]: Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Given a non-empty binary searc 阅读全文
posted @ 2018-03-17 22:45 苗妙苗 阅读(496) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all lef 阅读全文
posted @ 2018-03-17 21:49 苗妙苗 阅读(164) 评论(0) 推荐(0)
摘要: [抄题]: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of  阅读全文
posted @ 2018-03-17 19:45 苗妙苗 阅读(374) 评论(1) 推荐(0)
摘要: [抄题]: Find the sum of all left leaves in a given binary tree. Example: [暴力解法]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: root.left root.right只是递归 阅读全文
posted @ 2018-03-17 15:11 苗妙苗 阅读(124) 评论(0) 推荐(0)
摘要: [抄题]: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: [暴力解法]: 时间分析: 空间分析: [奇葩输出 阅读全文
posted @ 2018-03-17 10:03 苗妙苗 阅读(235) 评论(0) 推荐(0)
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 77 下一页