Algorithm
文章平均质量分 73
RMCYork
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Least Common Ancestor in a Binary Tree
The problem is: Given a binary tree (not a binary search tree) and two values say n1 and n2, write a program to find the least common ancestor. 思路: 如果原创 2014-11-04 13:41:58 · 373 阅读 · 0 评论 -
3种解决searching string的方法
The fundamental string searching (matching) problem is defined as follows: given two strings - a text and a pattern, determine whether the pattern appears in the text. The problem is also known as "th转载 2014-11-05 03:43:49 · 1414 阅读 · 0 评论 -
Reverse every word in a String
不能使用reverse啥的函数 public String reverseString(String str){ String temp = "", result = ""; for(int i=0;istr.length();i++) if ( (str.charAt(i)>='A' && str.charAt(i)原创 2014-11-08 15:26:50 · 536 阅读 · 0 评论 -
精度为p的float sqrt
写一个函数float sqrt(float x, int p), 要求返回的结果result平方后小数点后p位与原数x相同。基本思路二分法如下: public float sqrt(float x, int p) { if (x == 0) { return 0; } if (x < 0) {原创 2015-08-31 05:33:19 · 827 阅读 · 0 评论
分享