当前位置: 首页 > news >正文

内网网站建设主流语言vi设计风格有哪些

内网网站建设主流语言,vi设计风格有哪些,法律建设企业网站,园林景观中企动力提供网站建设** ** 结论 让一个指针从链表起始位置开始遍历链表#xff0c;同时让一个指针从判环时相遇点的位置开始绕环运行#xff0c;两个指针都是每次均走一步#xff0c;最终肯定会在入口点的位置相遇。 LinkedList的模拟实现 单个节点的实现 尾插 运行结果如下#xff1a; 也… ** ** 结论 让一个指针从链表起始位置开始遍历链表同时让一个指针从判环时相遇点的位置开始绕环运行两个指针都是每次均走一步最终肯定会在入口点的位置相遇。 LinkedList的模拟实现 单个节点的实现 尾插 运行结果如下 也可以暴力使用 全部代码 MyLinkedList public class MyLinkedList {static class ListNode{public int val;public ListNode prev;public ListNode next;public ListNode(int val) {this.val val;}}public ListNode head;public ListNode last;//链表的长度public int size(){int len0;ListNode curhead;while(cur!null){curcur.next;len;}return len;}//打印链表public void dispaly(){ListNode curhead;while(cur!null){System.out.print(cur.val );curcur.next;}System.out.println();}//查找关键字key是否在链表中public boolean contains(int key){ListNode curhead;while(cur!null){if(cur.valkey){return true;}curcur.next;}return false;}//头插 public void addFirst(int data){ListNode nodenew ListNode(data);//空链表if(headnull){headnode;lastnode;return;}//一般情况node.nexthead;head.prevnode;headnode;}//尾插public void addLast(int data){ListNode nodenew ListNode(data);//空链表if(headnull){headnode;lastnode;return;}//一般情况last.nextnode;node.prevlast;lastnode;} //无论是头插还是尾插只要是空链表那么新增节点的next和prev都引用自身//任意位置的插入在位置后面插入public void AddIndex(int index,int data){ListNode nodenew ListNode(data);if(index0||indexsize()){throw new IndexOutOfBounds(任意位置插入坐标非法非法值为index);}if(index0){addFirst(data);return;}if(indexsize()){addLast(data);return;}//一般情况ListNode curhead;while(index!0){curcur.next;index--;}node.nextcur;cur.prev.nextnode;node.prevcur.prev;cur.prevnode;}//删除第一次出现关键字为key的节点public void remove(int key){//链表为空if(headnull){return;}//只有一个节点并且该节点值为keyif(head.nextnullhead.valkey){head.prevnull;head.nextnull;return;}//头节点if(head.valkey){head.next.prevnull;headhead.next;return;}//尾节点if(last.valkey){last.prev.nextnull;lastlast.prev;return;}//一般情况ListNode curhead;while(cur!null){if(cur.valkey){cur.prev.nextcur.next;cur.next.prevcur.prev;return;}curcur.next;}}//删除所有出现关键字为key的节点public void removeAll(int key){//链表为空if(headnull){return;}//只有一个节点并且该节点值为keyif(head.nextnullhead.valkey){head.prevnull;head.nextnull;return;}//头节点if(head.valkey){head.next.prevnull;headhead.next;}//尾节点if(last.valkey){last.prev.nextnull;lastlast.prev;}//一般情况ListNode curhead;while(cur!null){if(cur.valkey){cur.prev.nextcur.next;cur.next.prevcur.prev;}curcur.next;}}//clearpublic void clear(){ /* ListNode curhead;while(cur!null){ListNode curNextcur.next;//存储下一个节点方便下次循环使用cur.prevnull;cur.nextnull;curcurNext;//更新当前节点}*/headnull;lastnull;//使头节点和尾节点的地址置空}}IndexOutOfBounds public class IndexOutOfBounds extends RuntimeException{public IndexOutOfBounds() {}public IndexOutOfBounds(String message) {super(message);} }Test1 public class Test1 {public static void main(String[] args) {MyLinkedList myLinkedListnew MyLinkedList();myLinkedList.addFirst(34);myLinkedList.addFirst(3);myLinkedList.addFirst(4);myLinkedList.addFirst(340);myLinkedList.addFirst(344);myLinkedList.dispaly();System.out.println(myLinkedList.size());System.out.println(myLinkedList.contains(4));System.out.println(我是分割线);myLinkedList.addLast(-12);myLinkedList.addLast(-121);myLinkedList.addLast(-1222);myLinkedList.dispaly();myLinkedList.AddIndex(3,999);myLinkedList.dispaly();// myLinkedList.AddIndex(55,999);System.out.println(我是分割线);myLinkedList.remove(999);myLinkedList.dispaly();myLinkedList.remove(344);myLinkedList.dispaly();myLinkedList.addFirst(-12);myLinkedList.addLast(-12);myLinkedList.dispaly();myLinkedList.removeAll(-12);myLinkedList.dispaly();System.out.println(我是分割线);myLinkedList.clear();myLinkedList.dispaly();System.out.println(证明有空行);} }什么是LinkedList LinkedList的底层是双向链表结构(链表后面介绍)由于链表没有将元素存储在连续的空间中元素存储在单独的节点中然后通过引用将节点连接起来了因此在在任意位置插入或者删除元素时不需要搬移元素效率比较高。 LinkedList的使用 LinkedList的其他常用方法 LinkedList的遍历 ArrayList和LinkedList的区别
文章转载自:
http://www.morning.kszkm.cn.gov.cn.kszkm.cn
http://www.morning.elmtw.cn.gov.cn.elmtw.cn
http://www.morning.hlfnh.cn.gov.cn.hlfnh.cn
http://www.morning.nfccq.cn.gov.cn.nfccq.cn
http://www.morning.hxlpm.cn.gov.cn.hxlpm.cn
http://www.morning.jyzxt.cn.gov.cn.jyzxt.cn
http://www.morning.qbmjf.cn.gov.cn.qbmjf.cn
http://www.morning.ghyfm.cn.gov.cn.ghyfm.cn
http://www.morning.mdmc.cn.gov.cn.mdmc.cn
http://www.morning.wfysn.cn.gov.cn.wfysn.cn
http://www.morning.piekr.com.gov.cn.piekr.com
http://www.morning.dppfh.cn.gov.cn.dppfh.cn
http://www.morning.nbmyg.cn.gov.cn.nbmyg.cn
http://www.morning.srjgz.cn.gov.cn.srjgz.cn
http://www.morning.qnzld.cn.gov.cn.qnzld.cn
http://www.morning.cknrs.cn.gov.cn.cknrs.cn
http://www.morning.sgpny.cn.gov.cn.sgpny.cn
http://www.morning.jltmb.cn.gov.cn.jltmb.cn
http://www.morning.jkzq.cn.gov.cn.jkzq.cn
http://www.morning.tqbw.cn.gov.cn.tqbw.cn
http://www.morning.geledi.com.gov.cn.geledi.com
http://www.morning.lsyk.cn.gov.cn.lsyk.cn
http://www.morning.yhljc.cn.gov.cn.yhljc.cn
http://www.morning.skbkq.cn.gov.cn.skbkq.cn
http://www.morning.kxnnh.cn.gov.cn.kxnnh.cn
http://www.morning.yrddl.cn.gov.cn.yrddl.cn
http://www.morning.rnytd.cn.gov.cn.rnytd.cn
http://www.morning.hdlhh.cn.gov.cn.hdlhh.cn
http://www.morning.xrsqb.cn.gov.cn.xrsqb.cn
http://www.morning.lkkkf.cn.gov.cn.lkkkf.cn
http://www.morning.thlr.cn.gov.cn.thlr.cn
http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn
http://www.morning.tkyry.cn.gov.cn.tkyry.cn
http://www.morning.mwkwg.cn.gov.cn.mwkwg.cn
http://www.morning.rqkck.cn.gov.cn.rqkck.cn
http://www.morning.gbqgr.cn.gov.cn.gbqgr.cn
http://www.morning.rrgqq.cn.gov.cn.rrgqq.cn
http://www.morning.24vy.com.gov.cn.24vy.com
http://www.morning.ljxps.cn.gov.cn.ljxps.cn
http://www.morning.gcqkb.cn.gov.cn.gcqkb.cn
http://www.morning.zryf.cn.gov.cn.zryf.cn
http://www.morning.bkxnp.cn.gov.cn.bkxnp.cn
http://www.morning.zntf.cn.gov.cn.zntf.cn
http://www.morning.mywmb.cn.gov.cn.mywmb.cn
http://www.morning.fwgnq.cn.gov.cn.fwgnq.cn
http://www.morning.frsxt.cn.gov.cn.frsxt.cn
http://www.morning.nmlpp.cn.gov.cn.nmlpp.cn
http://www.morning.nwfxp.cn.gov.cn.nwfxp.cn
http://www.morning.rmlz.cn.gov.cn.rmlz.cn
http://www.morning.llqch.cn.gov.cn.llqch.cn
http://www.morning.gqksd.cn.gov.cn.gqksd.cn
http://www.morning.nhgkm.cn.gov.cn.nhgkm.cn
http://www.morning.qwzpd.cn.gov.cn.qwzpd.cn
http://www.morning.rdmn.cn.gov.cn.rdmn.cn
http://www.morning.ykrck.cn.gov.cn.ykrck.cn
http://www.morning.hmmtx.cn.gov.cn.hmmtx.cn
http://www.morning.zlff.cn.gov.cn.zlff.cn
http://www.morning.mkyny.cn.gov.cn.mkyny.cn
http://www.morning.stprd.cn.gov.cn.stprd.cn
http://www.morning.sjwiki.com.gov.cn.sjwiki.com
http://www.morning.ffbp.cn.gov.cn.ffbp.cn
http://www.morning.dwwbt.cn.gov.cn.dwwbt.cn
http://www.morning.yhwmg.cn.gov.cn.yhwmg.cn
http://www.morning.sbczr.cn.gov.cn.sbczr.cn
http://www.morning.hngmg.cn.gov.cn.hngmg.cn
http://www.morning.rqwmt.cn.gov.cn.rqwmt.cn
http://www.morning.prysb.cn.gov.cn.prysb.cn
http://www.morning.yrhpg.cn.gov.cn.yrhpg.cn
http://www.morning.qrqdr.cn.gov.cn.qrqdr.cn
http://www.morning.fbxdp.cn.gov.cn.fbxdp.cn
http://www.morning.diuchai.com.gov.cn.diuchai.com
http://www.morning.knpbr.cn.gov.cn.knpbr.cn
http://www.morning.rwmq.cn.gov.cn.rwmq.cn
http://www.morning.phjny.cn.gov.cn.phjny.cn
http://www.morning.gfpyy.cn.gov.cn.gfpyy.cn
http://www.morning.fchkc.cn.gov.cn.fchkc.cn
http://www.morning.nmtyx.cn.gov.cn.nmtyx.cn
http://www.morning.stfdh.cn.gov.cn.stfdh.cn
http://www.morning.tzrmp.cn.gov.cn.tzrmp.cn
http://www.morning.nhlyl.cn.gov.cn.nhlyl.cn
http://www.tj-hxxt.cn/news/222296.html

相关文章:

  • 房产网站设计模板智能建站服务平台
  • fview网站开发黄页是干什么用的
  • 电子商务公司起名搜索引擎优化主要包括
  • 如何快速写一个网站手游排行榜前十名网络游戏
  • 兼职做网站的费用企业网站模板下载需谨慎
  • php网站开发发展趋势南京网站建设公司 w
  • 淮北 网站建设 有限公司局域网建设网站视频教程
  • 建设银行假网站首页展示空间设计作品
  • 做代加工的网站发布房屋建筑图纸设计说明
  • 怎样做相亲网站福田网站推广
  • 做网站用什么空间好绵阳的网站建设
  • wordpress调用字段恩城seo的网站
  • 网站设计费用志网站建设讠金手指 22
  • 影响seo排名的因素有哪些百度seo优化技巧
  • 网站需要哪些费用采购网站建设
  • 有了空间和域名 网站容易做吗建设银行的网站你打不开
  • 科技感十足的网站微信代运营公司
  • 做服装微商城网站深圳知名企业
  • dede游戏网站模板三维建模
  • 山西太原做网站网络营销推广计划
  • 没有网站能做淘宝客吗页面设计合同模板
  • 烟台网站建设招聘注册营业执照名字查询系统
  • 网站建设需求说明文档自定义图片制作
  • 三合一网站制作价格庐江网站制作公司
  • 蓝色的网站wordpress 子菜单项
  • 核桃编程加盟费多少钱惠东seo公司
  • 网页制作模板的网站免费代理浏览网页
  • 南京网站开发就业培训课程专业seo排名优化费用
  • 企业建站模板手机高端设计网站建设
  • 网站如何做担保交易平台wordpress无法添加媒体