2014年3月26日
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-26 17:29 月下美妞1314 阅读(2) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-26 17:28 月下美妞1314 阅读(1) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-26 17:27 月下美妞1314 阅读(1) 评论(0) 推荐(0) 编辑
  2014年3月17日
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-17 15:23 月下美妞1314 阅读(1) 评论(0) 推荐(0) 编辑
  2014年3月16日
摘要: 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注:实现这题我想了两种方法,1、将ListNode l2中的结点依次插入到l1中去,每次插入后使l1还是有序的2、使用归并排序在链表上实现的思想1、/** * Definition for singly-linked list. * public class ListNode { * int val; * ... 阅读全文
posted @ 2014-03-16 22:05 月下美妞1314 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.注:这道题使用了简单选择排序的思想。将数组从头开始向后遍历,当发现A[i]==elem时,将该数组最后一个位置的元素进行交换(最后一个位置随着删除元素,不断的变化)。public class Solution 阅读全文
posted @ 2014-03-16 18:33 月下美妞1314 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 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.注:这里使用直接插入排序在链表上实习的思想。将一个序列分割成两个部分,第一部分里面的元素都没有重复;第二部分里面的结点有待判断。逐个将第二部分中的元素加入到第一部分。/** * Definition for singly-li 阅读全文
posted @ 2014-03-16 18:28 月下美妞1314 阅读(146) 评论(0) 推荐(0) 编辑
  2014年3月13日
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-13 11:02 月下美妞1314 阅读(1) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-13 09:28 月下美妞1314 阅读(1) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-03-13 09:26 月下美妞1314 阅读(0) 评论(0) 推荐(0) 编辑