• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 一個Javascript鏈表

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    function Entry(next, data) { this.next = next this.data = data } function Iterator(node) { this.cousor = node this.hasNext = function () { return (this.cousor.next != null); } this.next = function () { var rt = this.cousor.next this.cousor
    function Entry(next, data)
    {
           this.next = next
           this.data = data
    }

    function Iterator(node)
    {
           this.cousor = node
           this.hasNext = function ()
           {
                   return (this.cousor.next != null);
           }
           this.next = function ()
           {
                   var rt = this.cousor.next
                   this.cousor = this.cousor.next
                   return rt.data
           }
    }

    function LinkedList()
    {
           this.head = new Entry(null, null)
           this.size = function ()
           {
                   var size = 0
                   if (this.head == null)
                   {
                           return size
                   }

                   var p = this.head.next
                   for(; p!=null; p = p.next)
                   size++;
                   return size;
           }

           this.clear = function ()
           {
                   this.head = null
           }

           this.getNode =  function (idx)
           {
                   var pos = -1;

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>