怎样建立个人网站网站集约化建设报告

pingmian/2025/10/14 0:46:36/文章来源:
怎样建立个人网站,网站集约化建设报告,什么网站专做二手名表,宝塔面板建设网站一、栈 Stack#xff08;存取O(1)#xff09; 先进后出#xff0c;进去123#xff0c;出来321。 基于数组#xff1a;最后一位为栈尾#xff0c;用于取操作。 基于链表#xff1a;第一位为栈尾#xff0c;用于取操作。 1.1、数组栈 /*** 基于数组实现的顺序栈#…一、栈 Stack存取O(1) 先进后出进去123出来321。 基于数组最后一位为栈尾用于取操作。 基于链表第一位为栈尾用于取操作。 1.1、数组栈  /*** 基于数组实现的顺序栈 items[0]表头/栈底 items[size-1]表尾/栈顶*/ public class MyArrayStack {// 存储元素的 数组private String items[];// 栈实际大小private int size 0;// 栈的容量private int capacity 0;public MyArrayStack(int capacity) {this.size 0;this.capacity capacity;this.items new String[capacity];}/*** 入栈*/public boolean push(String item) {if(size capacity){throw new IndexOutOfBoundsException(MyArrayStack 栈的内存满了);}items[size] item;size;return true;}/*** 出栈*/public String pop() {if(size0){throw new IndexOutOfBoundsException(MyArrayStack 栈的内存空了);}String item items[size-1];items[size-1] null;size--;return item;} } 1.2、链表栈  /*** 基于链表实现的链式栈 top: 表尾/栈顶*/ public class MyLinkedStack {// 表尾/栈顶private Node top null;/*** 入栈*/public void push(String value) {Node node new Node(value,null);if(top ! null){node.nextNode top;}top node;}/*** 出栈*/public String pop() {if(topnull){throw new IndexOutOfBoundsException(MyLinkedStack 栈的内存空了);}String retValue top.getValue();top top.nextNode;return retValue;}/*** 节点*/private static class Node{// 存储数据private String value;// 下个节点private Node nextNode;public Node(String value, Node nextNode) {this.value value;this.nextNode nextNode;}public String getValue() {return value;}} } 二、队列 Queue 存取O(1) 先进先出FIFO的有序列表  2.1、数组单向队列 存取O(1) /*** 基于数组实现的顺序队列*/ public class MyArrayQueue {private String [] items;// 容量private int capacity 0;// 队头下标private int head 0;// 队尾下标private int tail 0;public MyArrayQueue(int capacity) {this.items new String [capacity];this.capacity capacity;}/*** 入队*/public boolean enqueue(String item) {if(capacity tail){throw new IndexOutOfBoundsException(MyArrayQueue 容量满了);}items[tail] item;tail;return true;}/*** 出队*/public String dequeue() {if(headtail){throw new IndexOutOfBoundsException(MyArrayQueue 容量空了);}String retValue items[head];head;return retValue;} } 2.2、链表单向队列  /*** 基于链表实现的链式队列*/ public class MyLinkedListQueue {// 队头private Node head null;// 队尾private Node tail null;/*** 入队*/public void enqueue(String value) {Node node new Node(value,null);if(tailnull){head node;tail node;}else {tail.nextnode;tailnode;}}/*** 出队*/public String dequeue() {if(headnull){throw new IndexOutOfBoundsException(MyLinkedListQueue 队列空了);}String retValue head.getValue();head head.next;if (head null) {tail null;}return retValue;}private static class Node{private String value;private Node next;public Node(String value, Node next) {this.value value;this.next next;}public String getValue() {return value;}} } 三、链表 LinkedList  3.1、单向链表  /*** 单向普通链表*/ public class MyLinkedList {// 链表大小private int size;// 表头private Node head;/*** 插入*/public void insert(int index, String value) {if(index0){throw new IndexOutOfBoundsException(MyLinkedList 下标越界了);} else {if(headnull){head new Node(value,null);}else {if(indexsize){index size-1;}Node prev head;for(int i0;iindex;i){prev prev.next;}Node node new Node(value,prev);prev.next node;}size;}}/*** 获取*/public String get(int index){if(size0){throw new IllegalArgumentException(MyLinkedList 空链表);}if(index0 || indexsize) {throw new IllegalArgumentException(MyLinkedList 下标越界了);}Node prev head;for (int i0;iindex;i){prev prev.next;}return prev.getValue();}private class Node{private String value;private Node next;public Node(String value, Node next) {this.value value;this.next next;}public String getValue() {return value;}} } 3.2、双向链表  public class MyDoubleLinkedList {// 链表大小private int size;// 表头private Node head;// 表尾private Node tail;/*** 插入*/public void insert(int index,String data) {if(index 0) {throw new IndexOutOfBoundsException(MyDoubleLinkedList insert 下标越界);}Node node new Node(data,null,null);if(index 0) {head.next node.next;head node;return;}if(index size) {tail.prev node.prev;tail node;return;}Node cur this.head;while(index ! 0) {cur cur.next;index--;}node.next cur;cur.prev.next node;node.prev cur.prev;cur.prev node;}public String get(int index){if(index0||indexsize){throw new IndexOutOfBoundsException(MyDoubleLinkedList get 下标越界了);}if(index(size/2)){Node cur head;for(int i 0;iindex-1;i){cur head.next;}return cur.getValue();}else {index size-index;Node cur tail;for (int isize;iindex;i--){cur cur.prev;}return cur.getValue();}}private class Node{public String value;public Node prev;public Node next;public Node(String value, Node prev, Node next) {this.value value;this.prev prev;this.next next;}public String getValue() {return value;}} } 3.3、跳表  1.跳表由很多层结构组成level是通过一定的概率随机产生的 2.每一层都是一个有序的链表默认是升序 3.最底层(Level 1)的链表包含所有元素 4.如果一个元素出现在Level i 的链表中则它在Level i 之下的链表也都会出现 5.每个节点包含两个指针一个指向同一链表中的下一个元素一个指向下面一层的元素。 import java.util.Random;public class SkipList {// 跳表中存储的是正整数并且存储的数据是不重复的private static final int MAX_LEVEL 16;// 结点的个数private int levelCount 1;// 索引的层级数private final Node head new Node();// 头结点private final Random random new Random();// 查找操作public Node find(int value) {Node p head;for (int i levelCount - 1; i 0; --i) {while (p.next[i] ! null p.next[i].data value) {p p.next[i];}}if (p.next[0] ! null p.next[0].data value) {return p.next[0]; // 找到则返回原始链表中的结点} else {return null;}}// 插入操作public void insert(int value) {int level randomLevel();Node newNode new Node();newNode.data value;newNode.maxLevel level; // 通过随机函数改变索引层的结点布置Node[] update new Node[level];for (int i 0; i level; i) {update[i] head;}Node p head;for (int i level - 1; i 0; --i) {while (p.next[i] ! null p.next[i].data value) {p p.next[i];}update[i] p;}for (int i 0; i level; i) {newNode.next[i] update[i].next[i];update[i].next[i] newNode;}if (levelCount level) {levelCount level;}}// 删除操作public void delete(int value) {Node[] update new Node[levelCount];Node p head;for (int i levelCount - 1; i 0; --i) {while (p.next[i] ! null p.next[i].data value) {p p.next[i];}update[i] p;}if (p.next[0] ! null p.next[0].data value) {for (int i levelCount - 1; i 0; --i) {if (update[i].next[i] ! null update[i].next[i].data value) {update[i].next[i] update[i].next[i].next[i];}}}}// 随机函数private int randomLevel() {int level 1;for (int i 1; i MAX_LEVEL; i) {if (random.nextInt() % 2 1) {level;}}return level;}// Node内部类public static class Node {private int data -1;private final Node[] next new Node[MAX_LEVEL];private int maxLevel 0;// 重写toString方法Overridepublic String toString() {return {data: data ; levels: maxLevel };}}// 显示跳表中的结点public void display() {Node p head;while (p.next[0] ! null) {System.out.println(p.next[0] );p p.next[0];}System.out.println();} }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/87965.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

美容行业培训网站建设获取网页 代码 做网站

目录 题目链接:长度最小的子数组 题目描述 思路分析:滑动窗口(利用单调性,使用"同向双指针来优化) 细节处理 画图解析 代码 题目链接:最大连续1的个数 III 题目描述 思路分析:滑动窗口(同向双指针) 细节…

怎么做网站超市邢台

Civil 3D提供的基于.net的API和基于COM的API,现在推荐大家使用.net API,但有时也需要使用COM API。 这个例子演示如何使用COM API来导入DEM数据生成Civil 3D曲面。 Civil 3D开发中使用COM API需要添加的引用比较啰嗦,建议使用向导创建项目简化操作&#…

centos7.2做网站佛山市公司网站制作

FTP VS SFTP FTP是文件传输协议。在网站上,如果你想把文件和人共享,最便捷的方式莫过于把文件上传到FTP服务器上,其他人通过FTP客户端程序来下载所需要的文件。 FTP进行文件传输需要通过端口进行。一般所需端口为: 1. 控制链路—T…

东莞服务公司网站建设计算机网络技术是干嘛的

模拟弱网测试 操作:一、Rules - Customize Rules (快捷键CtrlR)弹出编辑器 二、接着CtrlF查找m_SimulateModem标志位 三、默认上传300ms,下载150ms 四、更改后,继续Rules - Performances - Simulate Modem Speeds勾上 …

俄语网站建设注意事项怎么开网店淘宝

摘要: 第一部分:基础知识 第二部分:MYISAM和INNODB索引结构 1、简单介绍B-tree B tree树 2、MyisAM索引结构 3、Annode索引结构 4、MyisAM索引与InnoDB索引相比较 第三部分:MYSQL优化 1、表数据类型选择 2、sql语句优化 (1) 最…

江西住房和城乡建设厅网站阿里云服务器做网站好用吗

strlne函数的使用 一.strlen函数的声明二.strlen函数的头文件三.相关题目代码1代码2题目1题目2题目3题目4题目5题目6 一.strlen函数的声明 size_t strlen ( const char * str );二.strlen函数的头文件 使用strlen函数我们需要使用以下头文件 #include <string.h>三.相…

网站建设 响应式 北京建筑培训网能发焊工证吗

基于android的课堂签到系统本科毕业论文(设计)题 目 基于Android的课堂签到系统学生姓名 XXX指导教师 XX学 院 信息科学与工程学院专业班级 计算机科学与技术0908班完成时间 2013年5月 摘 要在大学课堂中&#xff0c;签到问题一直困扰着老师和同学们。传统课堂签到的手段大多是…

万维网网站电商网站适合做响应式布局吗

1.WebAssembly 1.1 指令集 概念&#xff1a;二进制编码集合。 依据计算机组成原理和计算机概论&#xff0c;指令集是一组二进制编码。 作用&#xff1a;控制硬件。 这些二进制指令直接作用于硬件电路&#xff0c;控制硬件完成指定操作。 例如&#xff1a;控制数据进入某个寄存…

泉州商城网站开发设计百度首页百度一下

任务背景 ##一、真实案例 某同学刚入职公司&#xff0c;在熟悉公司业务环境的时候&#xff0c;发现他们的数据库架构是一主两从&#xff0c;但是两台从数据库和主库不同步。询问得知&#xff0c;已经好几个月不同步了&#xff0c;但是每天会全库备份主服务器上的数据到从服务…

网站建设对策react做的网站有哪些

摘要&#xff1a; Java 8 中的 Stream API 提供了一种新的处理集合和数组的方式&#xff0c;可以使代码更加简洁、易读&#xff0c;同时还可以提高性能。其中 map() 方法是比较常用的方法之一&#xff0c;它可以将 Stream 对象中的每个元素映射为另一个元素。本文将对 Java 8 中…

win7系统下动网站建设sem优化公司

数据集格式&#xff1a;Pascal VOC格式YOLO格式(不包含分割路径的txt文件&#xff0c;仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件) 图片数量(jpg文件个数)&#xff1a;1504 标注数量(xml文件个数)&#xff1a;1504 标注数量(txt文件个数)&#xff1a;1504 标注…

西安高新网站制作怎么办?

2013年国庆期的一则网络消息说&#xff0c;11万人看升旗留下了5吨垃圾。有人认为这是一则假消息&#xff0c;因为5吨&#xff1d;5000千克&#xff0c;110000500022千克/人&#xff0c;而每人携带22千克&#xff08;44斤&#xff09;的垃圾是不可能的。以前还看过一个说法&…

外卖网站开发能多少钱建立网站解析会员视频是犯什么罪

国货之光来喽 !!!!超火的colorkey空气唇釉给你们安排上 !!!R601 酒酿梅子超酷超性感的一支 !!这个颜色是偏调但是不显老的深草莓红 一点都不挑皮 谁涂谁白一个度&#xff5e;厚厚的涂一层气场值upup !R608 焦糖红棕偏橘棕调的红棕板栗 !!薄涂厚涂都显白、显气质&#xff01;味道…

网站制作价格行情wordpress变化

写在前面&#xff1a;三目运算符是我们经常在代码中使用的&#xff0c;a (bnull?0:1); 这样一行代码可以代替一个 if-else&#xff0c;可以使代码变得清爽易读。但是&#xff0c;三目运算符也是有一定的语言规范的。在运用不恰当的时候会导致意想不到的问题。前段时间遇到(一个…

自己做网站咋做有了页游源代码如何做网站

在足够多的新设备进入主流市场之前&#xff0c;5G已经在许多领域引起了越来越多的关注。从IT、零售、交通和制造业到医疗、娱乐、教育和农业&#xff0c;几乎每个行业都将在某种程度上受到5G的影响。 作者&#xff1a;李雪薇来源&#xff1a;IT168网站 在足够多的新设备进入主…

根据网站做app网站收录查询接口

内存函数主要用于动态分配和管理内存&#xff0c;它直接从指针的方位上进行操作&#xff0c;可以实现字节单位的操作。 其包含的头文件都是&#xff1a;string.h memcpy copy block of memory的缩写----拷贝内存块 格式&#xff1a; void *memcpy(void *dest, const void …

衡阳市网站建设公司北京网页制作公司物美价廉

Android系统启动加载流程&#xff1a; 参考图 Linux内核加载完毕启动init进程init进程fork出zygote进程zygote进程在ZygoteInit.main()中进行初始化的时候fork出SystemServer进程SystemServer进程开启的时候初始化ActivityThread和ActivityManagerService&#xff08;其它还有P…

咸阳网站建设推广装修工人

ElasticSearch系列整体栏目 内容链接地址【一】ElasticSearch下载和安装https://zhenghuisheng.blog.csdn.net/article/details/129260827【二】ElasticSearch概念和基本操作https://blog.csdn.net/zhenghuishengq/article/details/134121631【三】ElasticSearch的高级查询Quer…

做缓网站网页版的微信

文章目录 5.1 跨链交易分析5.1.1 基础知识5.1.2 重点案例&#xff1a;分析以太坊到 BSC 的跨链交易理论步骤和工具准备Python 代码示例构思步骤1: 设置环境和获取合约信息步骤2: 分析以太坊上的锁定交易步骤3: 跟踪BSC上的铸币交易 结论 5.1.3 拓展案例 1&#xff1a;使用 Pyth…

模板网站建设哪家专业上海企业查询官网

楼宇自动化在现代建筑中扮演着重要的角色&#xff0c;它可以集成和控制各种设备和系统&#xff0c;提高建筑的能效和舒适性。然而&#xff0c;不同的设备和系统通常使用不同的通信协议&#xff0c;这给楼宇自动化的实施带来了一定的挑战。为了解决这个问题&#xff0c;BACnet和…