2016年9月12日

82. Remove Duplicates from Sorted List II

摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2 阅读全文

posted @ 2016-09-12 22:42 三颗心 阅读(166) 评论(0) 推荐(0) 编辑

160. Intersection of Two Linked Lists

摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文

posted @ 2016-09-12 20:32 三颗心 阅读(171) 评论(0) 推荐(0) 编辑

142. Linked List Cycle II

摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you 阅读全文

posted @ 2016-09-12 19:49 三颗心 阅读(128) 评论(0) 推荐(0) 编辑

Search a 2D Matrix

摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文

posted @ 2016-09-12 19:20 三颗心 阅读(174) 评论(0) 推荐(0) 编辑

62. Unique Paths

摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文

posted @ 2016-09-12 13:24 三颗心 阅读(161) 评论(0) 推荐(0) 编辑

24. Swap Nodes in Pairs

摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文

posted @ 2016-09-12 13:01 三颗心 阅读(173) 评论(0) 推荐(0) 编辑

83. Remove Duplicates from Sorted List

摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文

posted @ 2016-09-12 12:11 三颗心 阅读(138) 评论(0) 推荐(0) 编辑

21. Merge Two Sorted Lists

摘要: 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 当我们得到两个链表 阅读全文

posted @ 2016-09-12 11:20 三颗心 阅读(356) 评论(0) 推荐(0) 编辑

141. Linked List Cycle

摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 阅读全文

posted @ 2016-09-12 11:00 三颗心 阅读(112) 评论(0) 推荐(0) 编辑

268. Missing Number

摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 阅读全文

posted @ 2016-09-12 10:52 三颗心 阅读(211) 评论(0) 推荐(0) 编辑

191. Number of 1 Bits

摘要: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit 阅读全文

posted @ 2016-09-12 10:40 三颗心 阅读(156) 评论(0) 推荐(0) 编辑

231. Power of Two

摘要: Given an integer, write a function to determine if it is a power of two. 阅读全文

posted @ 2016-09-12 10:26 三颗心 阅读(102) 评论(0) 推荐(0) 编辑

9. Palindrome Number

摘要: Determine whether an integer is a palindrome. Do this without extra space. 阅读全文

posted @ 2016-09-12 10:16 三颗心 阅读(171) 评论(0) 推荐(0) 编辑

88. Merge Sorted Array

摘要: 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 tha 阅读全文

posted @ 2016-09-12 09:57 三颗心 阅读(175) 评论(0) 推荐(0) 编辑

导航