摘要: Sort a linked list using insertion sort. 解题思路: 新建一个头结点 将链表有序的插入这个新链表 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * List... 阅读全文
posted @ 2015-03-12 12:45 aorora 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. 解题思路: 双指针(tail,pre)找到链表... 阅读全文
posted @ 2015-03-11 19:08 aorora 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o... 阅读全文
posted @ 2015-03-11 14:14 aorora 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2015-03-11 12:47 aorora 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?https://oj.leetcode.com/problems/l... 阅读全文
posted @ 2015-03-09 19:22 aorora 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 先前初学了《大话数据结构》,然后在网上看到了LeetCode的测试,于是开始刷题,第一题就是排行榜首位Given an array of integers, find two numbers such that they add up to a specific target number.The... 阅读全文
posted @ 2015-02-05 18:14 aorora 阅读(120) 评论(0) 推荐(0) 编辑
摘要: win7&Ubuntu双系统简单搭建系统指南 本文是自己老本子折腾Ubuntu的一些记录,主要是搭建了一个能够足够娱乐(不玩游戏)专注练习自己编程能力的内容。只是简单的写了关于系统的安装和一些配置环境的简单搭建。并没有深入探讨系统地各项内容。希望可以给香简单使用的同学参考。一、准备工作打开Ultra... 阅读全文
posted @ 2015-02-03 14:24 aorora 阅读(237) 评论(0) 推荐(0) 编辑