码迷,mamicode.com
首页 >  
搜索关键字:排序 python    ( 180003个结果)
[leetcode]Recover Binary Search Tree @ Python
原题地址:https://oj.leetcode.com/problems/recover-binary-search-tree/题意:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree...
分类:编程语言   时间:2014-05-26 13:25:43    阅读次数:261
python安装zlib一直无效
一直按网上的方法:1.先安装apt-get install zlib1g-dev2.重新安装python(3.3):即是./configure 再make再make install始终没有解决掉问题!最后发现,还需要再链接一次:#ln -s /usr/local/python3.3/bin/pyth...
分类:编程语言   时间:2014-05-26 12:35:01    阅读次数:298
C语言的经典排序算法源码
1、插入排序:插入法是一种比较直观的排序方法。它首先把数组头两个元素排好序,再依次把后面的元素插入适当的位置。把数组元素插完也就完成了排序。代码如下:#includevoid main(){int a[10];int i,j,k;printf("请输入10个数字!空格隔开\n");for(i=0;i...
分类:编程语言   时间:2014-05-26 11:45:36    阅读次数:344
归并排序
#includeusing namespace std;///算法重要,但是思想更重要 void MemeryArray(int a[],int n,int b[],int m,int c[])///经典框架,be careful!{ int i,j,k; i = j = k = 0; while(...
分类:其他好文   时间:2014-05-26 11:22:57    阅读次数:204
高可用,高性能,高扩展性 web服务
存储:文件存储: FastDFS数据库: MySQL(集群, mster, Slave读写分离),缓存: Redis, Memcache前端:Jquery, Angular框架:python django
分类:Web程序   时间:2014-05-26 11:16:56    阅读次数:240
[leetcode]Validate Binary Search Tree @ Python
原题地址:https://oj.leetcode.com/problems/validate-binary-search-tree/题意:检测一颗二叉树是否是二叉查找树。解题思路:看到二叉树我们首先想到需要进行递归来解决问题。这道题递归的比较巧妙。让我们来看下面一棵树: ...
分类:编程语言   时间:2014-05-26 10:48:19    阅读次数:291
[leetcode]Same Tree @ Python
原题地址:https://oj.leetcode.com/problems/same-tree/题意:判断两棵树是否是同一棵树。解题思路:这题比较简单。用递归来做。首先判断两个根节点的值是否相同,如果相同,递归判断根的左右子树。代码:# Definition for a binary tree n....
分类:编程语言   时间:2014-05-26 10:30:17    阅读次数:289
堆排序
#include#include#includeusing namespace std; //void MinHeapFixup(int a[], int i)//{// int j ,temp;// temp = a[i];// j = (i-1)/2;// while(j >= 0 && i !...
分类:其他好文   时间:2014-05-26 10:26:08    阅读次数:212
[leetcode]Symmetric Tree @ Python
原题地址:https://oj.leetcode.com/problems/symmetric-tree/题意:判断二叉树是否为对称的。Given a binary tree, check whether it is a mirror of itself (ie, symmetric around ...
分类:编程语言   时间:2014-05-26 10:18:52    阅读次数:293
[leetcode]N-Queens @ Python
原题地址:https://oj.leetcode.com/problems/n-queens/题意:经典的N皇后问题。解题思路:这类型问题统称为递归回溯问题,也可以叫做对决策树的深度优先搜索(dfs)。N皇后问题有个技巧的关键在于棋盘的表示方法,这里使用一个数组就可以表达了。比如board=[1, ...
分类:编程语言   时间:2014-05-26 10:07:52    阅读次数:274
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!