数据结构与算法(C#实现)系列---二叉堆(数组实现)[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 heavenkiller 的 blog

         public void enqueue(object _obj)

         {

              // todo:  添加 binaryheap.enqueue 实现

              if( this.array.count==this.array.capacity )

                   throw new exception("my:priority queue is full");//如果优先队列已满,则抛出异常

              this.array.add(new object());

              int i=this.array.count;

              while(i>1&&comparer.default.compare(this.array[i/2-1],_obj  )>0)

              {

                   //this.item(i)=this.item(i/2);

本文关键:数据结构,算法,C#,.Net
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top