【题目】
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
【题意】
给定一个已排序的链表,删除其中的重复元素
【思路】
维护两个指针prev和cur, cur指针负责扫描链表,prev指向cur的前一...
分类:
其他好文 时间:
2014-06-03 04:05:39
阅读次数:
231
已知一副RGB图像中的的像素值,利用matlab将其分割出来并以二进制图像形式显示:
%extract.m
clear all;
I=imread('new_original.png');
figure,imshow(I),title('Original Image');
bw=im2bw(I,0.3);
%figure,imshow(bw),title('Gray Image');
rgb=[...
分类:
其他好文 时间:
2014-06-03 02:46:26
阅读次数:
989
新买的香港云服务器,系统只能在商家的控制台上安装。
系统和硬盘分开的,根目录空间只有10G。需要重新设置相关目录的大小,如:/usr、/var、/home等。
以下是自己的解决方法小计。
一、初始的分区情况(外加一个300G未分区的硬盘):
[root@cloud ~]# df -TH
文件系统 类型 容量 已用 可用 已用%% 挂载点
/dev/mapper/vg...
分类:
系统相关 时间:
2014-06-03 02:35:20
阅读次数:
343
【题目】
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 original relative order of the nodes in each of the two partitions.
For example,
Given 1->4->3-...
分类:
其他好文 时间:
2014-06-03 00:02:29
阅读次数:
270
By reducing your bookmarks to show only the
icons, you can access more of them from the Bookmarks bar. This works great for
sites with recognizable fa...
分类:
其他好文 时间:
2014-06-02 17:39:03
阅读次数:
276
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space....
分类:
其他好文 时间:
2014-06-01 10:41:23
阅读次数:
242
【题目】
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0.
...
分类:
其他好文 时间:
2014-06-01 09:16:29
阅读次数:
242
最近在代码中经常看到bind关键词,之前没用过啊,这里记录下。从微软复制过来的例子:
// Define the original function.
var checkNumericRange = function (value) {
if (typeof value !== 'number')
return false;
else
return...
分类:
编程语言 时间:
2014-06-01 04:51:27
阅读次数:
481
【题目】
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->3->3->4->4->5, return 1->2->5.
Given 1->1->1->2->3, return 2->3.
【题意】
给定一个有序链表,删出其中重复出现的值...
分类:
其他好文 时间:
2014-05-31 21:14:11
阅读次数:
333
Qt作为一种基于 C++ 的跨平台 GUI
系统,能够提供给用户构造图形用户界面的强大功能。为了满足用户构造复杂图形界面系统的需求,Qt提供了丰富的多线程编程支持。从 2.2
版本开始,Qt主要从下面三个方面对多线程编程提供支持:一、构造了一些基本的与平台无关的线程类;二、提交用户自定义事件的 Th...
分类:
编程语言 时间:
2014-05-31 19:24:32
阅读次数:
343