
leetcode
大数据最好
大数据,机器学习,深度学习
展开
-
Remove Duplicates from Sorted Array
问题描述:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in p原创 2016-03-06 19:33:00 · 328 阅读 · 0 评论 -
Search in Rotated Sorted Array II
问题描述:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given targe原创 2016-03-06 20:50:49 · 352 阅读 · 0 评论 -
Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5, with the firs原创 2016-03-06 20:06:50 · 326 阅读 · 0 评论 -
Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array retur原创 2016-03-06 20:45:06 · 326 阅读 · 0 评论 -
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?代码实现:/** * Definition for singly-linked list. * class ListNode { *原创 2016-03-14 21:38:46 · 325 阅读 · 0 评论 -
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 solve it without using extra s原创 2016-03-14 21:41:43 · 412 阅读 · 0 评论