12 2017 档案

摘要:内部实现机理 map: map内部实现了一个红黑树,该结构具有自动排序的功能,因此map内部的所有元素都是有序的,红黑树的每一个节点都代表着map的一个元素,因此,对于map进行的查找,删除,添加等一系列的操作都相当于是对红黑树进行这样的操作,故红黑树的效率决定了map的效率。 unordered_ 阅读全文
posted @ 2017-12-29 22:03 皇家大鹏鹏 阅读(654) 评论(0) 推荐(0)
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-12-29 17:11 皇家大鹏鹏 阅读(226) 评论(0) 推荐(0)
摘要:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2017-12-29 15:35 皇家大鹏鹏 阅读(165) 评论(0) 推荐(0)
摘要:Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elemen 阅读全文
posted @ 2017-12-29 15:14 皇家大鹏鹏 阅读(170) 评论(0) 推荐(0)
摘要:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word 阅读全文
posted @ 2017-12-22 18:11 皇家大鹏鹏 阅读(110) 评论(0) 推荐(0)
摘要:Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文
posted @ 2017-12-22 11:13 皇家大鹏鹏 阅读(122) 评论(0) 推荐(0)
摘要:本篇博文记录了博主本人leetcode的刷题经历,持续更新中,一方面是方便自己日后复习;另一方面也是给大家的检索提供便利。本帖汇总了博主已经做完的leetcode的所有题目链接,如果大家有什么建议或者是更好的解法,也请大家多多指教 推荐一个大神的博客,这篇博客写链表环写的很好:http://www. 阅读全文
posted @ 2017-12-21 14:20 皇家大鹏鹏 阅读(514) 评论(0) 推荐(0)
摘要:Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
posted @ 2017-12-20 18:51 皇家大鹏鹏 阅读(259) 评论(0) 推荐(0)
摘要:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文
posted @ 2017-12-20 16:16 皇家大鹏鹏 阅读(237) 评论(0) 推荐(0)
摘要:Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2017-12-15 20:55 皇家大鹏鹏 阅读(161) 评论(0) 推荐(0)
摘要:Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on 阅读全文
posted @ 2017-12-13 14:50 皇家大鹏鹏 阅读(187) 评论(0) 推荐(0)
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 当然还有更逆天的算法,来自dis 阅读全文
posted @ 2017-12-12 22:01 皇家大鹏鹏 阅读(208) 评论(0) 推荐(0)
摘要:Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2017-12-07 18:05 皇家大鹏鹏 阅读(207) 评论(0) 推荐(0)
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
posted @ 2017-12-05 15:26 皇家大鹏鹏 阅读(227) 评论(0) 推荐(0)
摘要:Write a function to find the longest common prefix string amongst an array of strings. 题目的描述很简单,就是求多个字符串公共前缀,其实可以考虑先对字符向量用sort()进行排序,然后从前向后遍历,复杂度为O(S) 阅读全文
posted @ 2017-12-03 14:33 皇家大鹏鹏 阅读(139) 评论(0) 推荐(0)
摘要:本文是根据Coursera上吴恩达老师深度学习视频整理而成的笔记,包含课程所有精华内容,对深度学习感兴趣的同学还是推荐看看吴恩达老师的课程视频,讲解深入浅出,很适合作为入门教材,课程视频请在coursera官网或者网易云课堂观看。 一、误差分析 定义:有时我们希望算法能够胜任人类能做的任务,但是当算 阅读全文
posted @ 2017-12-01 20:52 皇家大鹏鹏 阅读(519) 评论(0) 推荐(0)