![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
muhudie
这个作者很懒,什么都没留下…
展开
-
链表相邻元素翻转,如1->2->3->4->5->6-7,翻转后变为:2->1->4->3->6->5->7。
package test;/* * 链表相邻元素翻转,如1->b->c->d->e->f-g,翻转后变为:b->a->d->c->f->e->g。 */public class NodeReverse { public static void main(String[] args) { int a[] = { 1, 2, 3, 4, 5, 6, 7 }; Node root原创 2014-09-18 14:17:52 · 799 阅读 · 0 评论 -
java atoi实现
package test;public class AtoiTest { public static void main(String[] args) { String str = "-2147483649"; long num = 0; try { num = strToInt(str); System.out.print(num); } catch (Exc原创 2014-09-18 18:15:37 · 519 阅读 · 0 评论 -
二叉树的创建 前序 中序 后序遍历以及最大值与最小值的差
package test;public class Tree { private Node root; public Tree() { root = null; } public static void main(String[] args) { int a[] = { 2, 5, 6, 1, 9, 6原创 2014-09-01 11:44:13 · 315 阅读 · 0 评论 -
排序总结一
基本思想:先将整个待排序记录序列原创 2014-09-04 11:52:02 · 350 阅读 · 0 评论 -
网易有道9-13北邮笔试题:输入字符串,将字符串里的*用0或1替换,输出所有可能的字符串
输入字符串,将字符串里的*用0或1替换,输出所有可能的字符串。原创 2014-09-13 22:01:41 · 874 阅读 · 0 评论 -
求字符串的最长重复子串
private static void count(String str) { if (str == null) return; int max = 0; // 重复字符串最大长度 int first = 0; // 重复字符串起始位置 int dis = 1; int k = 0; int j = 0; for (int i = 0; i + dis < str原创 2014-10-16 15:53:18 · 453 阅读 · 0 评论