ZMR小站

很高兴遇见你~


  • 首页

  • 标签

  • 分类

  • 归档

p75

发表于 2016-08-06 | 分类于 blog

LeetCode 75 Contains Duplicate 题解

1.题目:

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.

阅读全文 »

p41

发表于 2016-08-05 | 分类于 blog

LeetCode 41 First Missing Positive 题解

1.题目:

Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.

Your algorithm should run in O(n) time and uses constant space.

阅读全文 »

p148

发表于 2016-08-05 | 分类于 blog

LeetCode 148 Sort List 题解

1.题目:

Sort a linked list in O(n log n) time using constant space complexity.

阅读全文 »

p147

发表于 2016-08-05 | 分类于 blog

LeetCode 147 Insertion Sort List 题解

1.题目:

Sort a linked list using insertion sort.

阅读全文 »

p23

发表于 2016-08-05 | 分类于 blog

LeetCode 21 Merge k Sorted Lists 题解

1.题目:

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.

阅读全文 »

p21

发表于 2016-08-04 | 分类于 blog

LeetCode 21 Merge Two Sorted Lists 题解

1.题目:

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.

阅读全文 »

p88

发表于 2016-08-04 | 分类于 blog

LeetCode 88 Merge Sorted Array 题解

1.题目:

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
Note:
You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional elements from nums2. The number of elements initialized in nums1 and nums2 are m and n respectively.
Subscribe to see which companies asked this question

阅读全文 »
1…252627…33
ZhangMengRou

ZhangMengRou

ZMR小站

230 日志
4 分类
14 标签
© 2019 ZhangMengRou
由 Hexo 强力驱动
|
主题 — NexT.Gemini v5.1.4