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

电子商务网站建设规划心得免费建网站平台教

电子商务网站建设规划心得,免费建网站平台教,网站后台管理系统 静态页面,县级门户网站用什么源码好工作时间长了#xff0c;经常用框架#xff0c;感觉真的成了coding,建议有时间可以刷一下lettcode 时间一长就会忘#xff0c;写了大半天#xff0c;记录一下#xff0c;理解后再写特别简单#xff0c;链表逆序看了很多博客#xff0c;写法各式各样#xff0c;但是感觉…工作时间长了经常用框架感觉真的成了coding,建议有时间可以刷一下lettcode 时间一长就会忘写了大半天记录一下理解后再写特别简单链表逆序看了很多博客写法各式各样但是感觉解释的还是不清楚明了所以在这又总结一下 1.首先定义链表的结构  定义的结构NodeT 这样data 可以自定义的泛型增加了灵活性 public class NodeT {public T data;public Node next; //可以理解为C语言的指针public Node(){}public Node(T data){this.data data;}public T getData() {return data;}public void setData(T data) {this.data data;}public Node getNext() {return next;}public void setNext(Node next) {this.next next;} } 这里设计的 head 头指针数据默认为空也就是null; 执行 temp p ,pq 执行流程如下 执行 tmp p;pq;qq-next 其中qq-next 是类C/C写法进行解释  这里容易忽视p.nextnull 容易形成回环 qq-next在这里我理解为探针查询是否已经到链表结尾了  增删逆序具体代码如下 import java.lang.reflect.Array; import java.util.ArrayList;/*** ClassName MyList* Description* Author qianxl* Date 2019-09-07 17:34* Version 1.0**/ public class MyListT {public Node head new Node(-1);public Node current;/*** param data* description: 添加元素* return: {link Node}* author qianxl* date: 2019/9/7* since 1.0*/public Node add(T data) {Node temp head;Node before new Node();do {before temp;} while ((temp temp.next) ! null); //注释部分是代码重构使用do while // before temp; // while (temp ! null) { // before temp; // temp temp.next; // }temp new Node(data);before.next temp;return head;}public Node remove(T values) {Node data this.head;boolean flag false;Node before;Node temp data.next;do {before data;if (values.equals(temp.data)) {flag true;break;}} while ((temp temp.next) ! null); //注释部分是代码重构使用do while // Node temp data.next; // Node before data; // while (temp ! null) { // if (values.equals(temp.data)) { // flag true; // break; // } // before temp; // temp temp.next; // }if (flag) {before.next temp.next;}return head;}/*** param* description: 计算集合的长度* return: {link int}* author qianxl* date: 2019/9/7* since 1.0*/public int size() {Node data head;int count 0;Node tmp;while (data ! null) {data data.next;count;}return count - 1;//head 不存入数据}/*** param index* param value* description: 指定位置插入值* return: {link Node}* author qianxl* date: 2019/9/8* since 1.0*/public Node insert(int index, T value) {Node data head.next; //去掉头指针if (index this.size() || index 1) {return head;}if (index 1) {Node node new Node(value);node.next head.next; //将新建的节点的指针指向之前head 头结点指向的指针head.next node;return head;}int count 1;Node before data; //do {if (index count) {Node node new Node(value);node.next data;before.next node; //指向新建的节点break;}count;before data;data data.next;} while (data ! null); //注释部分是代码重构使用do while // Node before data; // while (data ! null) { // if (index count) { // Node node new Node(value); // node.nextdata; // before.nextnode; //指向新建的节点 // break; // } // count; // before data; // data data.next; // }return head;}/*** param* description: 链表逆序* return: {link Node}* author qianxl* date: 2019/9/8* since 1.0*/public Node reverse() {Node p,qnull;p head.next; //指针 引用q head.next.next;//q 指针可以理解为探针在探是否到达链表末尾了Node tmpnull;p.setNext(null); //防止回环while (q ! null) {tmp p;pq;qq.next; //qq-next 起到探针的作用p.nexttmp;}head.next p;return head;}public void print(Node node) {if (node.next null) {return;}Node temp node.next;while (temp ! null) {System.out.print(temp.data );temp temp.next;}System.out.println();}/*** param array* description: 将数组转换为list head.next 理解为C语言指针写链表操作一定要画图* return: {link Node}* author qianxl* date: 2019/9/7* since 1.0*/public Node arrayToList(T[] array) {Node data head;for (int i 0; i array.length; i) {Node node new Node(array[i]);data.next node; //表情指向前驱data node; //表示}return head;}public static void main(String arg[]) {MyListObject list new MyList();Node ddd list.add(ddd);list.add(this is a list);list.add(fffff);list.remove(ddd);list.print(ddd);Node node list.arrayToList(new String[]{2,3,4});list.print(node);// list.insert(1, 8);list.add(8);list.print(node);System.out.println();list.reverse();list.print(node);} } 总结
http://www.pierceye.com/news/723630/

相关文章:

  • 做网站感想室内设计联盟邀请码怎么弄
  • 上海高端网站制作公司互联网黄页是什么
  • 网站服务器在阿里云专有网络做网站
  • 泰坦科技网站建设js代码 嵌入网站
  • 首都之窗门户网站首页中山做百度网站的公司吗
  • 网站 关键字 标签dede关闭网站
  • 甘肃路桥建设集团公司网站网页搭建模板
  • 山西省住房和城乡建设厅官网长沙seo关键词
  • 红酒 网站 模板网页qq登录保护在哪里
  • 目前哪些企业需要做网站建设的呢官方网站建设最重要的是
  • 电影题材网页设计欣赏长春seo关键词排名
  • 深圳网站建设索q.479185700如何修改网站后台的用户名和密码
  • 长春网站推广专门做二手书网站或app
  • 北京智能网站建设制作什么叫优化
  • 免费移动网站建站wordpress加skype
  • 企业推广建站网页开发教程
  • 外贸网站定制开发网站虚拟主机过期
  • 学习网站建设要报班吗中国建设银行晋中分行网站
  • 学校网站建设经验介绍西安建设网站公司
  • 江西营销网站建设公司的企业诚信建设分析
  • 生活家装饰官方网站动画设计考研
  • 网站内部的信息安全建设怎么才能在百度上做引流呢
  • 男男做的视频网站wordpress 系统
  • 网站建设合同 附件上海网站制作费用
  • 知名的环保行业网站开发开发一个app难吗
  • 律师网站建设方案网站企业制作
  • 基础建设期刊在哪个网站可以查做网站咨询
  • 万网个人网站备案查询甘肃建设银行网站
  • 网站建设有什么费用wordpress国外主题网站
  • 手机网站下拉菜单代码com域名代表什么