- 博客(4)
- 收藏
- 关注
原创 LeetCode练习 两个排序数组的中位数
题目是已知两个排序数组,求它们的中位数,时间复杂度要求是O(log(m+n))。想了想,还是排序适合我。#include "stdafx.h"#include "cctype"#include "iostream"#include<math.h>#include <ctime>#include "afxtempl.h"#include "singleLink.h&
2018-02-26 14:45:19
209
原创 LeetCode练习 最长非重复子字符串
题目是说给定一个字符串,找其中非重复子字符串的最大长度. 我随机产生了0-9,大写字母,小写字母的ASCII码值组成一个长度60的字符串(保证有重复字符出现),然后是用char数组来实现的.string和char数组之间很容易转换.#define random(a,b) (rand()%(b-a+1)+a)#define MAX_NUM 60 //定义字符串长度int _tma...
2018-02-12 14:59:42
283
原创 leetcode练习 add two numbers
原题 You are given two linked listsrepresenting two non-negative numbers. The digits are stored in reverse orderand each of their nodes contain a single digit. Add the two numbers and returnit as a lin...
2018-02-08 13:20:48
188
原创 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 of the two numbers such that they add up to th
2018-02-05 12:29:43
186
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人