![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode(C++)
文章平均质量分 64
金星闪闪
大家好,新手初来乍到,本着学习的态度和大家好好交流,希望大家批评指正。
展开
-
Leetcode-2. Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link原创 2016-05-11 12:38:32 · 355 阅读 · 0 评论 -
Leetcode-1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nums =原创 2016-05-09 23:53:21 · 287 阅读 · 0 评论 -
Leetcode-3. Longest Substring Without Repeating Characters
Leetcode-3. Longest Substring Without Repeating CharactersO(n)时间复杂度,窗口滑动解决,遍历字符串,打访问标记,记录最大长度,如果有访问过(v),则从窗口左边开始寻找重复访问过的字符,找到后,该重复字符之前的字符设置为未访问过(关键),新窗口左边从该重复字符串下一位开始,右边从(v)的下一位开始,重新寻找最大长度不重复字符子串。原创 2016-05-19 11:27:57 · 229 阅读 · 0 评论 -
Leetcode-4. Median of Two Sorted Arrays
Leetcode-4. Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Merge Sort 二分法原创 2016-06-19 22:27:38 · 285 阅读 · 0 评论 -
Leetcode-29. Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.做除法,没有想到官网标准答案位运算,MAX_INT除1,用加减法循环算子一直是1,显然效率是问题想到的做法是用新的算子做被减数,用 去逼近除数,最后原创 2017-03-21 17:08:20 · 243 阅读 · 0 评论