上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 72 下一页
摘要: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo 阅读全文
posted @ 2018-02-25 16:21 乐乐章 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2018-02-25 15:49 乐乐章 阅读(156) 评论(0) 推荐(0) 编辑
摘要: stack: 括号匹配 20 :http://www.cnblogs.com/zle1992/p/8469603.html 最长括号匹配32 :http://www.cnblogs.com/zle1992/p/8469694.html RPN逆波兰表达式 150 :http://www.cnblog 阅读全文
posted @ 2018-02-24 15:00 乐乐章 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2018-02-24 14:36 乐乐章 阅读(304) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2018-02-24 14:12 乐乐章 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 反转链表: 206. 反转链表 1 class Solution { 2 public: 3 ListNode* reverseList(ListNode* head) { 4 if(head == nullptr || head->next == nullptr) return head; 5 L 阅读全文
posted @ 2018-02-23 21:43 乐乐章 阅读(116) 评论(0) 推荐(0) 编辑
摘要: DescriptionHintsSubmissionsDiscussSolution Pick One Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the arra 阅读全文
posted @ 2018-02-22 21:46 乐乐章 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], 1 \ 2 / 3 return [3,2,1]. 前序遍历 是 阅读全文
posted @ 2018-02-22 13:18 乐乐章 阅读(151) 评论(0) 推荐(0) 编辑
摘要: BST: 增:(插入)  若当前的二叉查找树为空,则插入的元素为根节点,  若插入的元素值小于根节点值,则将元素插入到左子树中,  若插入的元素值不小于根节点值,则将元素插入到右子树中,  递归上述过程,直到找到插入点为叶子节点 查: 给定一颗二叉查找树,查找某节点p的过程如下:  将当前 阅读全文
posted @ 2018-02-22 11:35 乐乐章 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 和为定值的m个数 np 问题(时间复杂度o(2**n)) code1: 暴力递归 解决 只有正数的情况 阅读全文
posted @ 2018-02-20 23:43 乐乐章 阅读(261) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 72 下一页