Sort a linked list using insertion sort.难度:84. 我自己的做法是使用了额外的空间,建立了一个新的sorted的LinkedList, 技巧还是建立一个dummy node做前置节点。 1 /** 2 * Definition for singly-lin....
分类:
其他好文 时间:
2014-09-17 13:30:42
阅读次数:
264
is_sort的原型:
::is_sorted
default (1)
template
bool is_sorted (ForwardIterator first, ForwardIterator last);
custom (2)
template
bool is_sorted (ForwardIterator fir...
分类:
其他好文 时间:
2014-09-17 10:17:32
阅读次数:
220
AngularJS 是Google 推出的一套前端JS开发的 MV* (Model-View-Whatever)框架,它引入了一些编译器的概念,比如编译、链接,具有强大的双向数据绑定(Two-way binding)和前端模板功能(directive),使得我们可以轻易实现高服用、高可扩展性的脚本,...
分类:
其他好文 时间:
2014-09-16 23:26:21
阅读次数:
303
什么是Pair 关于类Pair的介绍,下面是引自《C++ Standard Library》的一段话: The class pair is provided to treat two values as a single unit. It is used in several places wi.....
分类:
其他好文 时间:
2014-09-16 22:03:51
阅读次数:
176
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
分类:
其他好文 时间:
2014-09-16 22:03:01
阅读次数:
223
在一个由n个元素组成的集合中,第i个“顺序统计量(order statistic)”是该集合中第i小的元素。例如,在一个由n个元素组成的集合中,最小值是第1个顺序统计量,最大值是第n个顺序统计量。而“中位数(median)”总是出现在low((n+1)/2)或者high((n+1)/2)处,其中.....
分类:
其他好文 时间:
2014-09-16 20:31:01
阅读次数:
250
Edit Distance
Total Accepted: 14997 Total
Submissions: 59129My Submissions
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each oper...
分类:
其他好文 时间:
2014-09-16 19:01:41
阅读次数:
152
417. The lazy programmer
Problem code: LAZYPROG
A new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is a web-designer and an executive ...
分类:
其他好文 时间:
2014-09-16 16:00:10
阅读次数:
357
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2014-09-16 13:57:50
阅读次数:
163
This model generalizes logistic regression to classification problems where the class label y can take on more than two possible values. Softmax regre...
分类:
其他好文 时间:
2014-09-16 12:06:50
阅读次数:
891