
LeetCode
文章平均质量分 78
杰拉德er
Practices make perfect.
展开
-
【面试题】判断链表中是否有环
1. 快慢指针/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: boo原创 2016-04-18 22:51:56 · 340 阅读 · 0 评论 -
[c++]LeetCode Median of Two Sorted Arrays问题
问题描述:There 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)).总结大牛的算法如下:假设nums翻译 2015-10-18 08:54:35 · 319 阅读 · 0 评论 -
[c++] LeetCode longest substring without repeating characters问题
问题描述:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length i原创 2015-10-15 22:29:50 · 317 阅读 · 0 评论 -
[c++] LeetCode 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 i翻译 2015-10-14 15:24:20 · 448 阅读 · 0 评论 -
[c++] LeetCode Two Sum问题
谢谢师兄的推荐,LeetCode点击打开链接很适合来刷题,初步着手做编程练习题,下面是算法题第一题two sum问题的描述:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices翻译 2015-10-14 08:20:07 · 346 阅读 · 0 评论