码迷,mamicode.com
首页 > 编程语言 > 详细

[Java coding] leetcode notes

时间:2014-09-11 23:46:42      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:io   java   ar   art   sp   on   c   amp   ad   

Start from Difficulty 1:

1, Remove specified elem from unsorted array: 2 pointers, one is to iterate all the elements in the array, the other is to increase if current value is not equal to specified element. 

2, Remove duplicates from sorted array: still 2 pointers, compare current value with previous.

3, Remove 3rd duplicate from sorted array: on 2, have another var to store the appearance number.

4, Remove duplites from sorted linked list: prev & curr, then pay attention to null head input.

 

[Java coding] leetcode notes

标签:io   java   ar   art   sp   on   c   amp   ad   

原文地址:http://www.cnblogs.com/chayu3/p/3967433.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!