C语言链表操作

目录

链表基本操作

删除重复元素 

查找倒数第N个节点

查找中间节点

约瑟夫环

循环链表

合并有序链表

逆置链表

逆置链表(双向链表)


链表基本操作

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned char elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;
}void insert_node(int pos, unsigned char elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(void)
{struct node *p;for(p = head; p; p = p->next)printf("%c", p->elem);printf("\n");
}int search(unsigned char elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>struct node
{unsigned char elem;struct node *next;
};void create_list(unsigned char elem);
void insert_node(int pos, unsigned char elem);
void delete_node(int pos);
void print_linklist(void);
int search(unsigned char elem);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{create_list('A');create_list('B');create_list('C');create_list('D');print_linklist();delete_node(0);print_linklist();insert_node(0, 'F');insert_node(2, 'Z');print_linklist();if(search('C'))printf("the elem is found in the linklist\n");elseprintf("Can not find it\n");return 0;
}

删除重复元素 

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(struct node *linklist_head)
{struct node *p;for(p = linklist_head; p; p = p->next)printf("%5d", p->elem);printf("\n");
}int search(unsigned int elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}void delete_repeat(struct node *head)
{int flag[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};struct node *p = head;struct node *q = NULL;flag[p->elem] = 1;while(p->next != NULL){if(flag[p->next->elem] == 0){flag[p->next->elem] = 1;p = p->next;}else{q = p->next;p->next = q->next;free(q);}}
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>extern struct node *head;
extern struct node *tail;struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(struct node *linklist_head);
int search(unsigned int elem);
void delete_repeat(struct node *head);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{create_list(1);create_list(2);create_list(8);create_list(2);create_list(3);create_list(9);create_list(4);create_list(6);create_list(4);create_list(8);create_list(7);create_list(5);create_list(2);create_list(9);create_list(6);print_linklist(head);delete_repeat(head);print_linklist(head);return 0;
}

查找倒数第N个节点

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(struct node *linklist_head)
{struct node *p;for(p = linklist_head; p; p = p->next)printf("%5d", p->elem);printf("\n");
}int search(unsigned int elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}int find_mid(struct node *linklist_head)
{struct node *p;struct node *q;p = q = linklist_head;while(p != NULL && p->next != NULL){p = p->next->next;q = q->next;}return q->elem;
}int find_last_nth(struct node *linklist_head, int n)
{int i;struct node *p;struct node *q;p = q = linklist_head;for(i = 0; i < n-1; i++)p = p->next;while(p->next != NULL){p = p->next;q = q->next;}return q->elem;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>extern struct node *head;
extern struct node *tail;struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(struct node *linklist_head);
int search(unsigned int elem);
int find_mid(struct node *linklist_head);
int find_last_nth(struct node *linklist_head, int n);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{int n;create_list(1);create_list(2);create_list(3);create_list(4);create_list(5);create_list(6);create_list(7);create_list(8);create_list(9);create_list(10);print_linklist(head);printf("Please enter the last one you want to show:");scanf("%d", &n);printf("the last n :%d\n", find_last_nth(head, n));return 0;
}

查找中间节点

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(struct node *linklist_head)
{struct node *p;for(p = linklist_head; p; p = p->next)printf("%5d", p->elem);printf("\n");
}int search(unsigned int elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}int find_mid(struct node *linklist_head)
{struct node *p;struct node *q;p = q = linklist_head;while(p != NULL && p->next != NULL){p = p->next->next;q = q->next;}return q->elem;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>extern struct node *head;
extern struct node *tail;struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(struct node *linklist_head);
int search(unsigned int elem);
int find_mid(struct node *linklist_head);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{create_list(1);create_list(2);create_list(3);create_list(4);create_list(5);create_list(6);create_list(7);create_list(8);create_list(9);create_list(10);print_linklist(head);printf("mid = %d\n", find_mid(head));return 0;
}

约瑟夫环

约瑟夫问题是个著名的问题:N个人围成一圈,第一个人从1开始报数,报M的将被杀掉,下一个人接着从1开始报。如此反复,最后剩下一个,求最后的胜利者。
例如只有三个人,把他们叫做A、B、C,他们围成一圈,从A开始报数,假设报2的人被杀掉。

●首先A开始报数,他报1。侥幸逃过一劫。
●然后轮到B报数,他报2。非常惨,他被杀了
●C接着从1开始报数
●接着轮到A报数,他报2。也被杀死了。
●最终胜利者是C

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;tail->next = head;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;tail->next = head;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == head)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);tail->next = head;}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == head)tail = pre;free(p);}
}void print_linklist(void)
{struct node *p;p = head;//	for(p = head; p != head; p = p->next)
//		printf("%d", p->elem);do{printf("%5d", p->elem);p = p->next;}while(p != head);printf("\n");
}int search(unsigned int elem)
{struct node *p;p = head;//	for(p = head; p; p = p->next)
//		if(p->elem == elem)
//			return 1;do{if(p->elem == elem)return 1;p = p->next;}while(p != head);return 0;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>extern struct node *head;
extern struct node *tail;struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(void);
int search(unsigned int elem);#endif
//main.c#include <stdio.h>
#include "linklist.h"
#include <stdlib.h>int main(void)
{int n, k, m;int i;struct node *p, *q;printf("Please enter the number of person:");scanf("%d", &n);for(i = 1; i <= n; i++)create_list(i);print_linklist();p = head;printf("Please enter the start num:");scanf("%d", &k);while(--k)p = p->next;
//	printf("p->elem = %d\n", p->elem);printf("Please enter the m:");scanf("%d", &m);if(1 == m){for(i = 0; i < n; i++){printf("%3d", p->elem);p = p->next;}printf("\n");}else{while(n--){for(i = 1; i < m - 1; i++)p = p->next;q = p;p = p->next;printf("%3d", p->elem);q->next = p->next;free(p);p = p->next;}printf("\n");}return 0;
}

循环链表

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;tail->next = head;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;tail->next = head;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == head)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);tail->next = head;}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == head)tail = pre;free(p);}
}void print_linklist(void)
{struct node *p;p = head;//	for(p = head; p != head; p = p->next)
//		printf("%d", p->elem);do{printf("%5d", p->elem);p = p->next;}while(p != head);printf("\n");
}int search(unsigned int elem)
{struct node *p;p = head;//	for(p = head; p; p = p->next)
//		if(p->elem == elem)
//			return 1;do{if(p->elem == elem)return 1;p = p->next;}while(p != head);return 0;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(void);
int search(unsigned int elem);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{create_list(1);create_list(2);create_list(3);create_list(4);create_list(5);create_list(6);create_list(7);print_linklist();insert_node(0, 11);print_linklist();delete_node(6);print_linklist();delete_node(0);print_linklist();delete_node(0);print_linklist();delete_node(4);print_linklist();insert_node(0, 8);print_linklist();insert_node(5, 9);print_linklist();insert_node(2, 13);print_linklist();return 0;
}

合并有序链表

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(struct node *linklist_head)
{struct node *p;for(p = linklist_head; p; p = p->next)printf("%5d", p->elem);printf("\n");
}int search(unsigned int elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>extern struct node *head;
extern struct node *tail;struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(struct node *linklist_head);
int search(unsigned int elem);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{struct node *head1 = NULL;struct node *head2 = NULL;struct node *p = NULL;  //head1struct node *q = NULL;	//head2create_list(1);create_list(9);create_list(13);create_list(27);head1 = head;print_linklist(head1);head = NULL;create_list(3);create_list(5);create_list(14);create_list(81);create_list(88);create_list(95);create_list(99);head2 = head;print_linklist(head2);head = NULL;p = head1;q = head2;while(p && q){if(p->elem <= q->elem){if(head == NULL)head = p;elsetail->next = p;tail = p;p = p->next;}else{if(head == NULL)head = q;elsetail->next = q;tail = q;q = q->next;}}tail->next = p?p:q;print_linklist(head);return 0;
}

逆置链表

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->next = NULL;if(head == NULL)head = p;elsetail->next = p;tail = p;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->next = pre->next;pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(struct node *linklist_head)
{struct node *p;for(p = linklist_head; p; p = p->next)printf("%5d", p->elem);printf("\n");
}int search(unsigned int elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}int find_mid(struct node *linklist_head)
{struct node *p;struct node *q;p = q = linklist_head;while(p != NULL && p->next != NULL){p = p->next->next;q = q->next;}return q->elem;
}int find_last_nth(struct node *linklist_head, int n)
{int i;struct node *p;struct node *q;p = q = linklist_head;for(i = 0; i < n-1; i++)p = p->next;while(p->next != NULL){p = p->next;q = q->next;}return q->elem;
}void reverse_linklist(struct node *linklist_head)
{struct node *p, *n;p = linklist_head->next;linklist_head->next = NULL;while(p->next != NULL){n = p->next;p->next = linklist_head;linklist_head = p;p = n;}p->next = linklist_head;linklist_head = p;head = linklist_head;
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>extern struct node *head;
extern struct node *tail;struct node
{unsigned int elem;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(struct node *linklist_head);
int search(unsigned int elem);
int find_mid(struct node *linklist_head);
int find_last_nth(struct node *linklist_head, int n);
void reverse_linklist(struct node *linklist_head);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{int n;create_list(1);create_list(2);create_list(3);create_list(4);create_list(5);create_list(6);create_list(7);create_list(8);create_list(9);create_list(10);print_linklist(head);reverse_linklist(head);print_linklist(head);return 0;
}

逆置链表(双向链表)

//linklist.c#include "linklist.h"
#include <stdlib.h>struct node *head = NULL;
struct node *tail = NULL;void create_list(unsigned int elem)
{struct node *p = (struct node *)malloc(sizeof(struct node));p->elem = elem;p->pre = NULL;p->next = NULL;if(head == NULL)head = p;else{tail->next = p;p->pre = tail;}tail = p;
}void insert_node(int pos, unsigned int elem)
{struct node *pre;pre = head;int i = 0;struct node *p = (struct node *)malloc(sizeof(struct node));if(pos == 0){p->elem = elem;p->next = head;head->pre = p;p->pre = NULL;head = p;}else{while(i < pos - 1){pre = pre->next;i++;}p->elem = elem;p->pre = pre;p->next = pre->next;if(p->next != NULL)pre->next->pre = p; pre->next = p;if(p->next == NULL)tail = p;}
}void delete_node(int pos)
{struct node *pre, *p;pre = head;int i = 0;if(pos == 0){head = head->next;head->pre = NULL;free(pre);}else{while(i < pos - 1){pre = pre->next;i++;}p = pre->next;pre->next = p->next;if(p->next != NULL)p->next->pre = pre;else//if(p->next == NULL)tail = pre;free(p);}
}void print_linklist(void)
{struct node *p;for(p = head; p; p = p->next)printf("%5d", p->elem);printf("\n");
}int search(unsigned int elem)
{struct node *p;for(p = head; p; p = p->next)if(p->elem == elem)return 1;return 0;
}void reverse_print_linklist(void)
{struct node *p;for(p = tail; p; p = p->pre)printf("%5d", p->elem);printf("\n");
}
//linklist.h#ifndef LINKLIST_H__
#define LINKLIST_H__#include <stdio.h>struct node
{unsigned int elem;struct node *pre;struct node *next;
};void create_list(unsigned int elem);
void insert_node(int pos, unsigned int elem);
void delete_node(int pos);
void print_linklist(void);
int search(unsigned int elem);
void reverse_print_linklist(void);#endif
//main.c#include <stdio.h>
#include "linklist.h"int main(void)
{create_list(1);create_list(2);create_list(3);create_list(4);create_list(5);create_list(6);create_list(7);print_linklist();reverse_print_linklist();
/*insert_node(0, 11);print_linklist();delete_node(6);print_linklist();delete_node(0);print_linklist();delete_node(0);print_linklist();delete_node(4);print_linklist();insert_node(0, 8);print_linklist();insert_node(5, 9);print_linklist();insert_node(2, 13);print_linklist();
*/	return 0;
}

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

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

相关文章

React 18 state 状态更新函数

参考文章 把一系列 state 更新加入队列 设置组件 state 会把一次重新渲染加入队列。但有时可能会希望在下次渲染加入队列之前对 state 的值执行多次操作。为此&#xff0c;了解 React 如何批量更新 state 会很有帮助。 React 会对 state 更新进行批处理 在下面的示例中&…

Docker查看、创建、进入容器相关的命令

1.查看、创建、进入容器的指令 用-it指令创建出来的容器&#xff0c;创建完成之后会立马进入容器。退出之后立马关闭容器。 docker run -it --namec1 centos:7 /bin/bash退出容器&#xff1a; exit查看现在正在运行的容器命令&#xff1a; docker ps查看历史容器&#xff0…

docker小白第二天

centos上安装docker docker官网&#xff0c;docker官网&#xff0c;找到下图中的doc文档。 进入如下页面 选中manuals&#xff0c;安装docker引擎。 最终centos下的docker安装文档链接&#xff1a;安装文档链接. 具体安装步骤&#xff1a; 1、打开Centos&#xff0c;输入命…

【BASH】回顾与知识点梳理(十五)

【BASH】回顾与知识点梳理 十五 十五. 指令与文件的搜寻15.1 脚本文件名的搜寻which (寻找『执行档』) 15.2 文件档名的搜寻whereis (由一些特定的目录中寻找文件文件名)locate / updatedbfind与时间有关的选项与使用者或组名有关的参数与文件权限及名称有关的参数额外可进行的…

JVM垃圾回收

如何确定垃圾 对堆垃圾回收前的第一步就是要判断哪些对象已经死亡&#xff08;即不能再被任何途径使用的对象&#xff09; 引用计数法 这个方法就是为对象添加计数器来标识引用个数&#xff0c;计数器为 0 的对象就是不可能再被使用的。但是这种方法存在循环引用问题&#x…

布谷鸟配音:一站式配音软件

这是一款智能语音合成软件&#xff0c;可以快速将文字转换成语音&#xff0c;拥有多种真人模拟发音&#xff0c;可以选择不同男声、女声、童声&#xff0c;以及四川话、粤语等中文方言和外语配音&#xff0c;并且可对语速、语调、节奏、数字读法、多音字、背景音等进行全方位设…

less、sass的使用及其区别

CSS预处理器 CSS 预处理器是一种扩展了原生 CSS 的工具&#xff0c;它们添加了一些编程语言的特性&#xff0c;以便更有效地编写、组织和维护样式代码。预处理器允许开发者使用变量、嵌套、函数、混合等功能&#xff0c;从而使 CSS 更具可读性、可维护性和重用性&#xff0c;特…

学习笔记整理-JS-01-语法与变量

文章目录 一、语法与变量1. 初识JavaScript2. JavaScript的历史3. JavaScript与ECMAScript的关系4. JavaScript的体系5. JavaScript的语言风格和特性 二、语法1. JavaScript的书写位置2. 认识输出语句3. REPL环境&#xff0c;交互式解析器4. 变量是什么5. 重点内容 一、语法与变…

使用python快速搭建HTTP服务实现局域网网页浏览或文件传输

1.使用命令行&#xff08;CMD&#xff09;来快速搭建一个HTTP服务器 你可以借助Python的http.server模块。以下是在命令行中使用Python快速搭建HTTP服务器的步骤&#xff1a; 打开命令提示符&#xff08;CMD&#xff09;。 进入你想要共享文件的目录。使用 cd 命令来切换到目…

二、编写第一个 Spring MVC 程序

文章目录 一、编写第一个 Spring MVC 程序 一、编写第一个 Spring MVC 程序 代码示例 创建 maven 项目&#xff0c;以此项目为父项目&#xff0c;在父项目的 pom.xml 中导入相关依赖 <dependencies><dependency><groupId>junit</groupId><artifactI…

分支和循环语句(2)(C语言)

目录 do...while()循环 do语句的语法 do语句的特点 do while循环中的break和continue 练习 goto语句 do...while()循环 do语句的语法 do 循环语句; while(表达式); do语句的特点 循环至少执行一次&#xff0c;使用的场景有限&#xff0c;所以不是经常使用。 #inc…

【uniapp】uniapp自动导入自定义组件和设置分包:

文章目录 一、自动导入自定义组件&#xff1a;二、设置分包和预加载&#xff1a; 一、自动导入自定义组件&#xff1a; 【Volar 官网】https://github.com/vuejs/language-tools 二、设置分包和预加载&#xff1a; 【官方文档】https://uniapp.dcloud.net.cn/collocation…

【服务平台】Rancher运行和管理Docker和Kubernetes,提供管理生产中的容器所需的整个软件堆栈

Rancher是一个开源软件平台&#xff0c;使组织能够在生产中运行和管理Docker和Kubernetes。使用Rancher&#xff0c;组织不再需要使用一套独特的开源技术从头开始构建容器服务平台。Rancher提供了管理生产中的容器所需的整个软件堆栈。  完整软件堆栈 Rancher是供采用容器的团…

idea添加作者信息

idea添加作者信息 自定义作者信息idea添加作者信息自定义作者信息 自定义作者信息 idea添加作者信息 在idea中&#xff0c;经常会有这些波浪纹提示&#xff0c;放在上面之后会提示添加作者信息,点击添加作者信息后&#xff0c;但是不是自己想要的 这里提取的话好像没什么办法…

JavaWeb课程学习--Day01

HTML 建立css文件&#xff1a; css使用方式&#xff1a; <span>...</span>无语意包裹标签 css中的三种选择器&#xff1a; 注意&#xff1a;播放视音频时要留出播放空间 盒子模型&#xff1a; 表格标签&#xff1a; 以上表格&#xff1a; 表单标签&#xff1a; 表…

分布式 - 服务器Nginx:一小时入门系列之动静分离

文章目录 1. 动静分离的好处2. 分离静态文件3. 修改 Nginx 配置文件4. location 命令修饰符优先级 1. 动静分离的好处 Apache Tocmat 严格来说是一款java EE服务器&#xff0c;主要是用来处理 servlet请求。处理css、js、图片这些静态文件的IO性能不够好&#xff0c;因此&…

ROS学习--HelloWorld的实现(C++)

1.创建工作空间并初始化 mkdir -p 自定义空间名称/src cd 自定义空间名称 catkin_make上述命令&#xff0c;首先会创建一个工作空间以及一个 src 子目录&#xff0c;然后再进入工作空间调用 catkin_make命令编译。 2.进入 src 创建 ros 包并添加依赖 cd src catkin_create_pk…

苏纷享首届生态人脉会成功举办,纷享销客助力伙伴共同发展

近日&#xff0c;纷享销客&苏纷享成功举办了首届生态人脉会&#xff0c;该活动于8月3日下午在苏州东方之门举行。本次会议汇聚了来自近20家企业的销售精英&#xff0c;包括金蝶、泛微、夏谷、蚂蚁分工、创享、黑湖智造等众多知名企业。会议秉持着“建立生态、共同发展、深耕…

时间复杂度与空间复杂度的详解

目录 1.时间复杂度 2.时间复杂度计算例题 3.空间复杂度 1.时间复杂度 算法中的基本操作的执行次数&#xff0c;为算法的时间复杂度。 如何表达 时间复杂度&#xff1f; 大O的渐进表示法 实际中我们计算时间复杂度时&#xff0c;我们其实并不一定要计算精确的执行次数&#xf…

ArcGIS Pro暨基础入门、制图、空间分析、影像分析、三维建模、空间统计分析与建模、python融合、案例应用

GIS是利用电子计算机及其外部设备&#xff0c;采集、存储、分析和描述整个或部分地球表面与空间信息系统。简单地讲&#xff0c;它是在一定的地域内&#xff0c;将地理空间信息和 一些与该地域地理信息相关的属性信息结合起来&#xff0c;达到对地理和属性信息的综合管理。GIS的…