摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, return1->2->3.---10/01 YC version:/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next 阅读全文
posted @ 2013-09-16 10:35 LEDYC 阅读(121) 评论(0) 推荐(0)
摘要: Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target is in the array.---public class Solution { public boolean search(int[] A, int target) { return helper(A... 阅读全文
posted @ 2013-09-16 10:20 LEDYC 阅读(154) 评论(0) 推荐(0)