码迷,mamicode.com
首页 >  
搜索关键字:do while循环    ( 14864个结果
c++ 快速排序
介绍给大家一个快速排序的方法: void sort(int  a[ ], int l, int r) { int i = l; int j = r; int mid = a[(i+j)/2];      do   {         while(a[i] while(a[j] >mid ) j--; if( i { swap( a[i], a[j] ); }...
分类:编程语言   时间:2014-06-20 13:15:03    阅读次数:292
Construct Binary Tree from Preorder and Inorder Traversal
题目 Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 方法 根据树的中序遍历和前序遍历,来构造树,使用递归的思想。 Tre...
分类:其他好文   时间:2014-06-20 12:14:49    阅读次数:262
MongoDB第二弹——基本操作
查询已经创建的数据库 show dbs 选择数据库 use DATABASE_NAME 查询该数据库里面的集合 show collections 删除集合操作: db.COLLECTION_NAME.drop() 插入数据操作: db.COLLECTION_NAME.insert( do...
分类:数据库   时间:2014-06-20 10:57:41    阅读次数:275
Java深度历险(二) EJB Session Bean有状态和无状态的区别与联系
等等通过实例自己实践之后的清晰了很多,多动手多动手,TO Do TO DO !...
分类:编程语言   时间:2014-06-20 09:43:55    阅读次数:306
DOM和SAX的比较
1.DOM和SAX的区别:     1)dom把所有的xml文档信息都存于内存中        sax无需一次把xml文件加载到内存中,采用的是事件驱动的操作     2)dom应用场景:对于大文件来说几乎不可能使用        dom可以直接获取某个节点的操作Document.get,而sax不可以   2.DOM和SAX的优缺点: DOM的优势主要表现在:易用性强,使用DO...
分类:其他好文   时间:2014-06-20 09:26:24    阅读次数:300
JavaScript中模块“写法”
在JavaScript模块到底是什么event = function() { // do more return { bind: function() {}, unbind: function() {}, trigger: function() ...
分类:编程语言   时间:2014-06-20 08:50:47    阅读次数:408
socket编程(一):简单回射C/S程序
服务端代码://echoSvr.c#include #include #include #include #include #include #include #include #include #define ERR_EXIT(m) \ do \ { \ perror(...
分类:其他好文   时间:2014-06-11 22:15:11    阅读次数:292
数据挖掘经典算法——K-means算法
算法描述 K-means算法是一种被广泛使用的基于划分的聚类算法,目的是将n个对象会分成k个簇。算法的具体描述如下:随机选取k个对象作为簇中心;Do 计算所有对象到这k个簇中心的距离,将距离最近的归入相应的簇; 重新计算每个簇的中心; 计算准则...
分类:其他好文   时间:2014-06-11 10:37:42    阅读次数:192
projecteuler---->problem=19----Counting Sundays
You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday.Thirty days has September, April, June and November. All the rest have thirty...
分类:其他好文   时间:2014-06-07 13:56:52    阅读次数:166
leetcode——String to Integer (atoi) 字符串转换为整型数(AC)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:其他好文   时间:2014-06-07 12:21:30    阅读次数:284
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!