
C++技术汇总
文章平均质量分 61
liangliang
澳门大学在读研究生
展开
-
Levenshtein Distance Levenshtein 编辑距离——一种相似度的计算方法
/********************************************* Levenshtein Distance Algorithm *******************************//************************************************************************************原创 2011-10-30 18:44:47 · 1480 阅读 · 0 评论 -
计算数组中最大值、最小值和平均值的方法(The methods of calculating the maximum, minimum and average of a array )
计算一个数据的最大值最小值和平均值是很常用的方法,最近因为要用到这些方法,特总结如下,因为较常见,具体的分析方法就不提供了:/*********************************************Get the maximum of the input values*******************************//********************原创 2011-10-30 18:56:58 · 3041 阅读 · 0 评论 -
对各种数据类型进行排序 sort any type data
通常要是闲一组数据的排序要创建一个函数,而实现另外一组类类型的数据排序时又要创建一个函数,但是如果使用函数模板就可以通过一个函数来实现。本实例将通过函数模板实现不同类型数据的排序。函数模板的声明方式如下:template 下面给出一个具体的函数:/******************************************* Sort any tpye arr原创 2011-10-30 18:52:19 · 1783 阅读 · 0 评论 -
LCA问题:求二叉树中任意两个节点的最近公共祖先
问题描述:英语:Given an arbitrary binary tree, propose amethod to determine the first common ancestor of 2 randomly selected nodes in the tree中文:求二叉树中任意两个节点的最近公共祖先也称为LCA问题(Lowest Common Ancestor)。其实这道问题是许多面转载 2012-01-03 10:44:51 · 5431 阅读 · 0 评论