Given a singly linked list where elements are
sorted in ascending order, convert it to a height balanced BST.1.
将LinkedList的值保存到一个数组中,转化成Convert Sorte...
分类:
其他好文 时间:
2014-05-12 05:53:09
阅读次数:
367
原题地址:http://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/题意:Given
a binary tree, flatten it to a linked list in-place.For example,Given...
分类:
编程语言 时间:
2014-05-12 05:30:32
阅读次数:
367
前面分别介绍了邻接矩阵有向图的C和C++实现,本文通过Java实现邻接矩阵有向图。目录 1.
邻接矩阵有向图的介绍 2. 邻接矩阵有向图的代码说明 3. 邻接矩阵有向图的完整源码
转载请注明出处:http://www.cnblogs.com/skywang12345/更多内容:数据结构与算法系列 ....
分类:
编程语言 时间:
2014-05-12 02:12:39
阅读次数:
307
看了下JAVA里面有HashMap、Hashtable、HashSet三种hash集合的实现源码,这里总结下,理解错误的地方还望指正HashMap和Hashtable的区别HashSet和HashMap、Hashtable的区别HashMap和Hashtable的实现原理HashMap的简化实现My...
分类:
其他好文 时间:
2014-05-12 01:46:52
阅读次数:
413
Sort a linked list using insertion
sort.//用到O(N)的额外空间public class Solution { public ListNode
insertionSortList(ListNode head) { if(head==nul...
分类:
其他好文 时间:
2014-05-11 23:59:09
阅读次数:
405
/// /// 返回insert后的主键值 /// /// /// /// public static
int ExecuteSql(string SQLString, List para) ...
分类:
数据库 时间:
2014-05-11 16:07:50
阅读次数:
400
Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-05-11 16:03:43
阅读次数:
327
水贴王问题
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:水贴王问题
博客时间:2014-5-7;
编程语言:Java ;
编程坏境:Windows 7 专业版 x64;
编程工具:jdk,eclipse...
分类:
其他好文 时间:
2014-05-11 14:22:50
阅读次数:
296
//链表操作:建立、插入、删除、查找、倒置、删除等基本操作
#include
#include
typedef
struct LNode
{
int data;
structLNode *next;
}LNode,*Llist;
LNode *creat_head();//创建一个空表
void creat_list(LNode *,int);//创...
分类:
其他好文 时间:
2014-05-11 03:33:11
阅读次数:
351
import java.util.Scanner;
// 并查集 判断一个图中有几个联通块
public class UnionFind {
private int[] father;//
private int count;// 分量数量
public UnionFind(int N){
count=N;
father=new int[N];
for(int i=0;i<N...
分类:
其他好文 时间:
2014-05-11 03:03:44
阅读次数:
308