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

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

  • <strong id="5koa6"></strong>
  • Android筆試總結(4)

    發表于:2013-06-03來源:Csdn作者:xyz_lmn點擊數: 標簽:Android
    this.count = count; } public Node getNextNode() { return nextNode; } publicvoid setNextNode(Node nextNode) { this.nextNode = nextNode; } } ReverseSingleLink.java publicclass ReverseSingleLink { public

      this.count = count;

      }

      public Node getNextNode() {

      return nextNode;

      }

      publicvoid setNextNode(Node nextNode) {

      this.nextNode = nextNode;

      }

      }

      ReverseSingleLink.java

      publicclass ReverseSingleLink {

      publicstatic Node revSingleLink(Node head){

      if(head ==null){ //鏈表為空不能逆序

      return head;

      }

      if(head.getNextNode()==null){ //如果只有一個結點,當然逆過來也是同一個

      return head;

      }

      Node rhead = revSingleLink(head.getNextNode());

      head.getNextNode().setNextNode(head);

      head.setNextNode(null);

      return rhead;

      }

      publicstaticvoid main(String[] args){

      Node head =new Node(0);

      Node temp1 =null,temp2 =null;

      for(int i=1;i<100;i++){

      temp1 =new Node(i);

      if(i==1){

      head.setNextNode(temp1);

      }else{

      temp2.setNextNode(temp1);

      }

      temp2 = temp1;

      }

      head = revSingleLink(head);

      while(head!=null){

      head = head.getNextNode();

      }

      }

      }

    原文轉自:http://blog.csdn.net/xyz_lmn/article/details/6922224

    老湿亚洲永久精品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>