随笔分类 - Algorithm
Algorithm
单链表操作相关算法
摘要:整理一些面试当中经常遇到的问题 帮助自己记忆.链表的类型: 单向链表,双向链表,循环链表C++ 链表的例子typedef struct IntElement { struct IntElement *next; int data;} IntElement;c# 实现 public class LinkNode { public LinkNode Next; public object Data;}操作链表常犯的错误:C#public void insertInFront( LinkNode list, Object data){ LinkNode temp = new LinkNode();
阅读全文
Get depth of BTree
摘要:public int GetDepth(BTreeNode node){ if(node == null) return 0; else { int d1=GetDepth(node.LNode); int d2=GetDepth(node.RNode); } return d1>d2?d1++:d2++; }
阅读全文
Quick sort C# code(2)
摘要:public class QuickSortNonRecursion{ public int Split(int[] data,int low,int high) { if(data == null) throw new ArgumentNullException(); if(low<0 || high >= data.length) throw new ArgumentOutOfR...
阅读全文
Quick sort C# code
摘要:public class IntQuickSort{private static int Split(int[] data,int low,int high) {if(data == null) throw new ArgumentException(); if(low<0 || high >= data.length) throw new ArgumentOutOfRangeExce...
阅读全文
posted @ 2008-06-30 11:16
stone
浙公网安备 33010602011771号