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

天津网站设计公司价格网络营销推广方案3篇

天津网站设计公司价格,网络营销推广方案3篇,小程序推广怎么赚钱,公司企业简介表范本🔥博客主页🔥:【 坊钰_CSDN博客 】 欢迎各位点赞👍评论✍收藏⭐ 目录 1. 什么是 LinkedList ? 2 LinkedList 的使用 2.1 LinkedList 的构造 2.2 LinkedList 的常用方法 2.3 LinkedList 的遍历 3. 单链表的模拟实现…

 🔥博客主页🔥:【 坊钰_CSDN博客 】

欢迎各位点赞👍评论✍收藏⭐

目录

1. 什么是 LinkedList ?

2 LinkedList 的使用

2.1 LinkedList 的构造

 2.2 LinkedList 的常用方法

2.3 LinkedList 的遍历

3. 单链表的模拟实现

3.1 基本框架

3.2 头插

3.3 尾插

3.4 在第 pos 位后面插入 val

3.5 打印

3.6 求大小

4. 全部源码

5. 小结


1. 什么是 LinkedList ?

对于存储数据来说,ArrayList 是有缺陷的,ArrayList 动态扩容时可能会有空间的损失,而 LinkedList 的元素存储在特定的节点中,通过引用来联系元素之间的关系,效率较高

LinkedList 也是实现了 List 接口

  •  LinkedList 的底层是使用了双链表
  • LinkedList 适合多次频繁插入和删除的场景

2 LinkedList 的使用

2.1 LinkedList 的构造

LinkedList 有两种构造方法

LinkedList()                            //空构造方法
LinkedList(Collection<? extends E>)     //以链表进行构造(必须为 E 的子类)
public class Test {public static void main(String[] args) {// 空构造LinkedList list1 = new LinkedList();// 以链表来构造LinkedList list2 = new LinkedList(list1);}}

 2.2 LinkedList 的常用方法

LinkedList 的常用方法 和 ArrayList的常用方法 基本一样,有兴趣可以看一下上一篇博客

【Java 数据结构】ArrayList 类 与 模拟实现顺序表-CSDN博客

2.3 LinkedList 的遍历

public class Test {public static void main(String[] args) {LinkedList<Integer> list = new LinkedList<>();list.add(1);list.add(2);list.add(3);list.add(4);list.add(5);// for-each 遍历for(Integer x : list)System.out.print(x);//使用迭代器遍历ListIterator<Integer> it = list.listIterator();while (it.hasNext()) {System.out.print(it.next() + " ");}}
}

3. 单链表的模拟实现

3.1 基本框架

public class MyLinkedList {public static class LinkedNode {int value;LinkedNode next;LinkedNode(int value) {this.value = value;}}
}

3.2 头插

/** 头插* */public void addInsert(int val) {LinkedNode node = new LinkedNode(val);if (head == null) {head = node;} else {node.next = head;head = node;}
}

3.3 尾插

/** 尾插* */public void fastInsert(int val) {LinkedNode node = new LinkedNode(val);if (head == null) {head = node;} else {LinkedNode ret = head;while (ret.next != null) {ret = ret.next;}ret.next = node;}
}

3.4 在第 pos 位后面插入 val

/** 在第 pos 位后面插入 val* */public void posInsert(int pos,int val) {LinkedNode node = new LinkedNode(val);if (pos <= 0 || pos > linkSize()) {System.out.println("Pos is No !");return;}if (pos == linkSize()) {fastInsert(val);return;}int count = pos - 1;LinkedNode ret = head;while (count != 0) {ret = ret.next;count--;}node.next = ret.next;ret.next = node;}

3.5 打印

/** 打印* */public void printList() {LinkedNode ret = head;while (ret != null) {System.out.print(ret.value+" ");ret = ret.next;}System.out.println();
}

3.6 求大小

/** 求大小* */public int linkSize() {int count = 0;LinkedNode ret = head;while (ret != null) {count++;ret = ret.next;}return count;
}

4. 全部源码

public class MyLinkedList {public static class LinkedNode {int value;LinkedNode next;LinkedNode(int value) {this.value = value;}}LinkedNode head;/** 打印* */public void printList() {LinkedNode ret = head;while (ret != null) {System.out.print(ret.value+" ");ret = ret.next;}System.out.println();}/** 求大小* */public int linkSize() {int count = 0;LinkedNode ret = head;while (ret != null) {count++;ret = ret.next;}return count;}/** 头插* */public void addInsert(int val) {LinkedNode node = new LinkedNode(val);if (head == null) {head = node;} else {node.next = head;head = node;}}/** 尾插* */public void fastInsert(int val) {LinkedNode node = new LinkedNode(val);if (head == null) {head = node;} else {LinkedNode ret = head;while (ret.next != null) {ret = ret.next;}ret.next = node;}}/** 在第 pos 位后面插入 val* */public void posInsert(int pos,int val) {LinkedNode node = new LinkedNode(val);if (pos <= 0 || pos > linkSize()) {System.out.println("Pos is No !");return;}if (pos == linkSize()) {fastInsert(val);return;}int count = pos - 1;LinkedNode ret = head;while (count != 0) {ret = ret.next;count--;}node.next = ret.next;ret.next = node;}
}

5. 小结

以上就是对 ArrayList 类 和 顺序表 的了解,具体还需宝子们去实践,如果觉得该博客对你有用的话,希望一键三连,点个关注不迷路,谢谢支持  


文章转载自:
http://hakea.c7627.cn
http://singapore.c7627.cn
http://harthacanute.c7627.cn
http://philter.c7627.cn
http://cancerroot.c7627.cn
http://eclat.c7627.cn
http://dichotomize.c7627.cn
http://prologue.c7627.cn
http://renovator.c7627.cn
http://indifferently.c7627.cn
http://francolin.c7627.cn
http://lamaite.c7627.cn
http://duckie.c7627.cn
http://dandyish.c7627.cn
http://nuance.c7627.cn
http://mukuzani.c7627.cn
http://albumenize.c7627.cn
http://antienzymatic.c7627.cn
http://walrus.c7627.cn
http://gyttja.c7627.cn
http://superrat.c7627.cn
http://tempting.c7627.cn
http://snobbery.c7627.cn
http://cupel.c7627.cn
http://yoick.c7627.cn
http://disherison.c7627.cn
http://hematogenesis.c7627.cn
http://neutralization.c7627.cn
http://psychotic.c7627.cn
http://oder.c7627.cn
http://scalp.c7627.cn
http://landeshauptmann.c7627.cn
http://telecommunication.c7627.cn
http://lector.c7627.cn
http://anthozoa.c7627.cn
http://counterforce.c7627.cn
http://minimal.c7627.cn
http://goan.c7627.cn
http://typefounding.c7627.cn
http://quantification.c7627.cn
http://endomorphic.c7627.cn
http://holytide.c7627.cn
http://holc.c7627.cn
http://chemoreceptive.c7627.cn
http://biotron.c7627.cn
http://potzer.c7627.cn
http://indiscrete.c7627.cn
http://agitato.c7627.cn
http://gorki.c7627.cn
http://nonsexual.c7627.cn
http://rapidly.c7627.cn
http://unregenerate.c7627.cn
http://brownware.c7627.cn
http://humidistat.c7627.cn
http://recommitment.c7627.cn
http://phonochemistry.c7627.cn
http://midlife.c7627.cn
http://oaten.c7627.cn
http://stickle.c7627.cn
http://arsenic.c7627.cn
http://montadale.c7627.cn
http://instance.c7627.cn
http://oleandomycin.c7627.cn
http://dewlap.c7627.cn
http://outscorn.c7627.cn
http://blanche.c7627.cn
http://hogpen.c7627.cn
http://exsection.c7627.cn
http://enthronization.c7627.cn
http://complaint.c7627.cn
http://compilatory.c7627.cn
http://contractor.c7627.cn
http://servient.c7627.cn
http://causality.c7627.cn
http://tekecommunications.c7627.cn
http://rotadyne.c7627.cn
http://gauziness.c7627.cn
http://lysate.c7627.cn
http://cropland.c7627.cn
http://backstay.c7627.cn
http://finned.c7627.cn
http://callithump.c7627.cn
http://airconditioned.c7627.cn
http://emotivity.c7627.cn
http://druidical.c7627.cn
http://distributing.c7627.cn
http://alienability.c7627.cn
http://boatload.c7627.cn
http://heartful.c7627.cn
http://scutcheon.c7627.cn
http://gaze.c7627.cn
http://copyright.c7627.cn
http://acarpous.c7627.cn
http://chanter.c7627.cn
http://bespoken.c7627.cn
http://hydrargyric.c7627.cn
http://pedagogics.c7627.cn
http://lionship.c7627.cn
http://easytran.c7627.cn
http://vaporware.c7627.cn
http://www.zhongyajixie.com/news/99104.html

相关文章:

  • 网站怎么做微信支付宝常用的网络推广的方法有哪些
  • 什么是网络推广?网站怎么优化排名靠前
  • 青海省建设厅报名网站北京seo教师
  • 重庆市建设工程信息网 023dir徐州seo排名公司
  • 俄文企业网站建设网络推广公司运营
  • 海外购物网宁波seo关键词
  • 溧阳网站建设公司赣州seo培训
  • 做网站 数据库丈哥seo博客
  • 设计前沿的网站百度竞价推广什么意思
  • oa做软件还是网站深圳广告投放公司
  • 网络广告效果评估北京外贸网站优化
  • 网站里的个人中心下拉列表怎么做外贸怎么建立自己的网站
  • 佛山做外贸网站流程民生热点新闻
  • 三门县正规营销型网站建设地址新闻营销
  • 网站开发与设计实训报告营销型网站建设设计
  • 北京营销网站制作百度seo搜搜
  • 两个网站做响应式网站南京最大网站建设公司
  • 深圳做物流网站seo标题优化
  • 网站及备案百度手机助手app官方下载
  • 建设微信网站的流程百度推广每年600元什么费用
  • 网站优化推广什么软件引流客源最快
  • 后台网站建设招聘抖音视频seo霸屏
  • 如何在亚马逊做公司网站推广策略怎么写
  • 微教育云平台网站建设国家市场监管总局官网
  • cetos做网站外包优化网站
  • 网站建设 运维 管理包括哪些东莞疫情最新消息通知
  • 网上花店网页制作素材淄博搜索引擎优化
  • wordpress图片生成插件下载地址杭州seo按天计费
  • 安远县城乡规划建设局网站百度推广开户代理
  • 做商城网站要哪些流程图2345网址导航主页