当前位置: 首页 > 编程日记 > 正文

基础数据结构【二】————动态数组,单向链表及链表的反转

DEMO1:     动态分配变量(链表,而静态数组是线性表,意味着动态数组访问和遍历复杂度为O(n),而插入和删除复杂度为O(1),而静态数组线性表则完全相反)

    int* intptr = new int(50);          //声明一指向整数的指针,在该内存中存入整数值50float* floatptr = new float;        //声明一指向浮点数的指针,但未指定内存中存储的数据值cout << "intptr 指向的数据值:" << *intptr << "\n\n";*floatptr = 0.5;cout << "floatptr 指向的数据值:" << *floatptr << "\n\n";delete intptr;delete floatptr;int *ptr=new int[num]; // 动态分配数组为n个元素 delete [] ptr;                // 释放分配给 ptr 的内存空间

DEMO2: 动态数组求和示例

int main() {int no, count = 0, Total = 0;   // 定义整数变量 count 与 Totalcout << "要输入计算的个数为:";cin >> no;int* ptr = new int[no]; // 动态分配数组为n个元素 cout << endl;for (count = 0; count < no; count++){cout << "输入ptr[" << count << "]:";cin >> ptr[count];            // 采用数组下标来输入数组元素}for (count = 0; count < no; count++)Total += *(ptr + count);       // 采用指针变量运算来存取数组的元素值cout << "---------------------------------------" << endl;cout << no << "个数的总和=" << Total;    // 显示结果cout << endl;delete[] ptr;                // 释放分配给 ptr 的内存空间ptr = NULL;system("pause");return 0;
}

DEMO3: 单向链表的创建与遍历:

输入12个学生的成绩(形成列表并打印)

#include <iostream>
using namespace std;
class list  //链表结构声明
{
public:int num, score;   //学号,得分char name[10];    //姓名class list* next; //指针变量,指向下一个节点
};
typedef class list node;
typedef node* link;int main()
{link newnode, ptr, delptr; //声明三个链表结构的指针cout << "请输入 5 位学生的数据:" << endl;delptr = new node;   //delptr暂当链表头指针if (!delptr){cout << "[Error!!内存分配失败!]" << endl;exit(1);}cout << "请输入座号:";cin >> delptr->num;cout << "请输入姓名:";cin >> delptr->name;cout << "请输入成绩:";cin >> delptr->score;ptr = delptr;   //保留链表头指针,以ptr为指向当前节点的指针for (int i = 1; i < 5; i++){newnode = new node;  //创建新节点if (!newnode){cout << "[Error!!内存分配失败!" << endl;exit(1);}cout << "请输入座号:";cin >> newnode->num;cout << "请输入姓名:";cin >> newnode->name;cout << "请输入成绩:";cin >> newnode->score;newnode->next = NULL;ptr->next = newnode; //把新节点加在链表后面ptr = ptr->next;     //让ptr保持在链表的最后面}cout << "\n  学  生  成  绩" << endl;cout << " 座号\t姓名\t成绩\n=====================" << endl;ptr = delptr;            //让ptr回到链表头while (ptr != NULL){cout << ptr->num << "\t" << ptr->name << "\t" << ptr->score << endl;delptr = ptr;ptr = ptr->next;     //ptr按序往后遍历整个链表delete delptr;     //释放内存空间}system("pause");
}

ptr = delptr;   //保留链表头指针,以ptr为指向当前节点的指针

newnode->next = NULL;   
        ptr->next = newnode; //把新节点加在链表后面
        ptr = ptr->next;     //让ptr保持在链表的最后面

step1:动态分配内存给新节点使用

step2:将原链表尾部的指针指向新元素所存在的位置(内存地址)

step3:将ptr指针指向新节点内存位置,表示这是新的链表尾部

step4:由于新的节点为当前链表的最后一个元素,所以将他的指针(next)指向NULL

DEMO4:

输入想删除的成绩(比如输入76),就开始遍历该链表,找到删除(含有76)该学生的节点,然后提示,输入新的成绩,学号,姓名。结束的时候输入 -1 ,即可输出全部列表

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string.h> 
#include <iomanip> //操作符的头文件 
using namespace std;
class list
{
public:int num, score;char name[10];class list* next;//指向下一个节点
};
typedef class list node;//定义node为新的数据类型
typedef node* link;     //定义link为新的数据类型指针   link findnode(link head, int num)
{link ptr;ptr = head;while (ptr != NULL){if (ptr->num == num)return ptr;ptr = ptr->next;}return ptr;
}link insertnode(link head, link ptr, int num, int score, char name[10])
{link InsertNode;InsertNode = new node;if (!InsertNode)return NULL;InsertNode->num = num;InsertNode->score = score;strcpy_s(InsertNode->name, name);InsertNode->next = NULL;if (ptr == NULL) //插入第一个节点{InsertNode->next = head;return InsertNode;}else{if (ptr->next == NULL)//插入最后一个节点{ptr->next = InsertNode;}else //插入中间节点{InsertNode->next = ptr->next;ptr->next = InsertNode;}}return head;
}int main()
{link head, ptr, newnode;int new_num, new_score;char new_name[10];int i, j, position = 0, find, data[12][2];char namedata[12][10] = { {"Allen"},{"Scott"},{"Marry"},{"John"},{"Mark"},{"Ricky"},{"Lisa"},{"Jasica"},{"Hanson"},{"Amy"},{"Bob"},{"Jack"} };srand((unsigned)time(NULL));cout << "座号  成绩  座号  成绩  座号  成绩  座号  成绩" << endl;cout << "==============================================" << endl;for (i = 0; i < 12; i++){data[i][0] = i + 1;//座号data[i][1] = rand() % 50 + 51;//成绩}for (i = 0; i < 3; i++){for (j = 0; j < 4; j++)cout << "[" << data[j * 3 + i][0] << "]  [" << data[j * 3 + i][1] << "]   ";cout << endl;}head = new node;  //建立链表头指针if (!head){cout << "Error!! 内存分配失败!!" << endl;exit(1);}head->num = data[0][0];for (j = 0; j < 10; j++)head->name[j] = namedata[0][j];head->score = data[0][1];head->next = NULL;ptr = head;for (i = 1; i < 12; i++) //建立链表{newnode = (link)malloc(sizeof(node));newnode->num = data[i][0];for (j = 0; j < 10; j++)newnode->name[j] = namedata[i][j];newnode->score = data[i][1];newnode->next = NULL;ptr->next = newnode;ptr = ptr->next;}while (1){cout << "请输入要插入其后的学生编号,结束输入-1:";cin >> position;if (position == -1)//循环中断条件break;else{ptr = findnode(head, position);cout << "请输入新插入的学生编号:";cin >> new_num;cout << "请输入新插入的学生成绩:";cin >> new_score;cout << "请输入新插入的学生姓名:";cin >> new_name;head = insertnode(head, ptr, new_num, new_score, new_name);}}ptr = head;cout << "\n\t座号\t    姓名\t成绩\n";cout << "\t==============================\n";while (ptr != NULL){cout << "\t[" << ptr->num << "]\t[ " << ptr->name << "]" << setw(6) << "\t[" << ptr->score << "]\n";ptr = ptr->next;}delete head;system("pause");return 0;
}

DEMO5: 删除链表节点

#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>  //使用随机数的头文件
using namespace std;
class list
{public:int num,score;char name[10];class list *next;
};
list del_ptr(list *head,list *ptr);
int main()
{  list *ptr;int findword=0,find,data[12][2];char namedata[12][10]={{"Allen"},{"Moko"},{"Lean"},{"Melissa"},{"Angel"},{"Sabrina"},{"Joyce"},{"Jasica"},{"Hanson"},{"Amy"},{"Bob"},{"Jack"}};srand((unsigned)time(NULL));//以时间为随机数的种子cout<<"座号 成绩  座号 成绩  座号 成绩  座号  成绩"<<endl;cout<<"=============================================="<<endl;for(int i=0;i<12;i++){  data[i][0]=i+1;data[i][1]=rand()%50+51;}for(int i=0;i<3;i++){  for (int j=0;j<4;j++)cout<<"["<<data[j*3+i][0]<<"]  ["<<data[j*3+i][1]<<"]  ";cout<<endl;}list *head=new list;//建立链表头指针if(!head){  cout<<"Error!! 内存分配失败!!"<<endl;exit(1);}head->num=data[0][0];for (int j=0;j<10;j++)head->name[j]=namedata[0][j];head->score=data[0][1];head->next=NULL;ptr=head;for(int i=1;i<12;i++)                   {  list *newnode=new list;//建立链表newnode->num=data[i][0];for (int j=0;j<10;j++)newnode->name[j]=namedata[i][j];newnode->score=data[i][1];newnode->next=NULL;ptr->next=newnode;ptr=ptr->next;}while(1){  cout<<"请输入要删除的成绩,结束输入-1:";cin>>findword;if(findword==-1)//循环中断条件break;else{  ptr=head;find=0;while (ptr!=NULL){  if(ptr->score==findword)     {  *ptr=del_ptr(head,ptr);//删除数据find++;}ptr=ptr->next;}if(find==0)cout<<"######没有找到######"<<endl;}}ptr=head;cout<<"\n\t座号\t    姓名\t成绩"<<endl; //输出剩余链表中的数据cout<<"\t=============================="<<endl;while(ptr!=NULL){  cout<<"\t["<<ptr->num<<"]\t["<<setw(10)<<ptr->name<<"]\t["<<ptr->score<<"]"<<endl;ptr=ptr->next;}system("pause");
}
list del_ptr(list *head,list *ptr)//删除节点子程序
{  list *top;top=head;if(ptr==head)//[情形1]:删除节点在链表头部{  head=head->next;cout<<"已删除第 "<<ptr->num<<" 号学生!!姓名: "<<ptr->name<<endl;}else{  while(top->next!=ptr)//找到删除节点的前一个位置top=top->next;if(ptr->next==NULL)  //[情形2]:删除节点在链表尾部{  top->next=NULL;cout<<"已删除第 "<<ptr->num<<" 号学生!!姓名: "<<ptr->name<<endl;}else  //[情形3]:删除节点在链表中间的任一节点{  top->next=ptr->next;cout<<"已删除第 "<<ptr->num<<" 号学生!!姓名: "<<ptr->name<<endl;}}delete []ptr;  //释放内存空间return *head;  //返回链表
}

DEMO6:将学生成绩按座号反转打印出来,单链链表反转

/*
[名称]:ch03_06.cpp
[示范]:将学生成绩按座号反转打印出来
*/
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
using namespace std;
class list
{public:int num,score;char name[10];class list *next;
};
typedef class list node;
typedef node *link;
int main()
{  link ptr,last,before;int i,j,findword=0,data[12][2];char namedata[12][10]={{"Allen"},{"Mako"},{"Lean"},{"Melissa"},{"Angel"},{"Sabrina"},{"Joyce"},{"Jasica"},{"Hanson"},{"Amy"},{"Bob"},{"Jack"}};srand((unsigned)time(NULL));for (i=0;i<12;i++){  data[i][0]=i+1;data[i][1]=rand()%50+51;}link head=new node;//建立链表头指针if(!head){  cout<<"Error!! 内存分配失败!!"<<endl;exit(1);}head->num=data[0][0];for (j=0;j<10;j++)head->name[j]=namedata[0][j];head->score=data[0][1];head->next=NULL;ptr=head;for(i=1;i<12;i++) //建立链表{  link newnode=new node;newnode->num=data[i][0];for (j=0;j<10;j++)newnode->name[j]=namedata[i][j];newnode->score=data[i][1];newnode->next=NULL;ptr->next=newnode;ptr=ptr->next;}ptr=head;i=0;cout<<"原始链表数据:"<<endl;               while (ptr!=NULL)                       {   //打印链表数据cout<<"["<<setw(2)<<ptr->num<<setw(8)<<ptr->name<<setw(3)<<ptr->score<<"] -> ";i++;if(i>=3) //三个元素为一行{  cout<<endl;i=0;}ptr=ptr->next;}ptr=head;before=NULL;cout<<"\n反转后链表数据:"<<endl;          while(ptr!=NULL) //链表反转{  last=before;before=ptr;ptr=ptr->next;before->next=last;}ptr=before;while(ptr!=NULL){  cout<<"["<<setw(2)<<ptr->num<<setw(8)<<ptr->name<<setw(3)<<ptr->score<<"] -> ";i++;if(i>=3){  cout<<endl;i=0;}ptr=ptr->next;}system("pause");
}

DEMO7: 单向链表连接功能

/*
[名称]:ch03_07.cpp
[示范]:单向链表的连接功能
*/
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class list
{
public:int num, score;char name[10];class list* next;
};
typedef struct list node;
typedef node* link;
link concatlist(link, link);int main()
{link head, ptr, newnode, last, before;link head1, head2;int i, j, findword = 0, data[12][2];//第一组链表的姓名 char namedata1[12][10] = { {"Allen"},{"Scott"},{"Marry"},{"Jon"},{"Mark"},{"Ricky"},{"Lisa"},{"Jasica"},{"Hanson"},{"Amy"},{"Bob"},{"Jack"} };//第二组链表的姓名char namedata2[12][10] = { {"May"},{"John"},{"Michael"},{"Andy"},{"Tom"},{"Jane"},{"Yoko"},{"Axel"},{"Alex"},{"Judy"},{"Kelly"},{"Lucy"} };srand((unsigned)time(NULL));for (i = 0; i < 12; i++){data[i][0] = i + 1;data[i][1] = rand() % 50 + 51;}head1 = new node; //建立第一组链表的头指针if (!head1){cout << "Error!! 内存分配失败!!" << endl;exit(1);}head1->num = data[0][0];for (j = 0; j < 10; j++)head1->name[j] = namedata1[0][j];head1->score = data[0][1];head1->next = NULL;ptr = head1;for (i = 1; i < 12; i++)//建立第一组链表{newnode = new node;newnode->num = data[i][0];for (j = 0; j < 10; j++)newnode->name[j] = namedata1[i][j];newnode->score = data[i][1];newnode->next = NULL;ptr->next = newnode;ptr = ptr->next;}srand((unsigned)time(NULL));for (i = 0; i < 12; i++){data[i][0] = i + 13;data[i][1] = rand() % 40 + 41;}head2 = new node; //建立第二组链表的头指针if (!head2){cout << "Error!! 内存分配失败!!\n";exit(1);}head2->num = data[0][0];for (j = 0; j < 10; j++)head2->name[j] = namedata2[0][j];head2->score = data[0][1];head2->next = NULL;ptr = head2;for (i = 1; i < 12; i++)//建立第二组链表{newnode = new node;newnode->num = data[i][0];for (j = 0; j < 10; j++)newnode->name[j] = namedata2[i][j];newnode->score = data[i][1];newnode->next = NULL;ptr->next = newnode;ptr = ptr->next;}i = 0;ptr = concatlist(head1, head2);//将链表相连接cout << "两个链表相连接的结果:" << endl;while (ptr != NULL){   //输出链表数据cout << "[" << ptr->num << " " << ptr->name << "  " << ptr->score << " ]\t-> ";i++;if (i >= 3)//三个元素为一行{cout << endl;i = 0;}ptr = ptr->next;}delete newnode;delete head2;system("pause");return 0;
}
link concatlist(link ptr1, link ptr2)
{link ptr;ptr = ptr1;while (ptr->next != NULL)ptr = ptr->next;ptr->next = ptr2;return ptr1;
}

相关文章:

VMware15克隆虚拟机Centos

在克隆虚拟机之前&#xff0c;我们需要了解以下文件&#xff1a; 1、/etc/udev/rules.d/70-persistent-net.rules 这是网卡有关信息的配置文件&#xff0c;我们可以先查看一下master的网卡信息&#xff08;当然也可以用ifconfig命令查看&#xff09; 要注意的是网卡名称以及…

EXPDP 时ORA-27054 问题处置

现象&#xff1a;[oracleoracle1 ~]$ expdp xian/xian schemasxian directorydumpdir dumpfilexian.dmp LOGFILExian.logExport: Release 10.2.0.5.0 - 64bit Production on Friday, 02 December, 2016 20:19:48Copyright (c) 2003, 2007, Oracle. All rights reserved.Connec…

OSC源创会往期图文回顾链接地址收藏

为什么80%的码农都做不了架构师&#xff1f;>>> 格式&#xff1a;源创会报名链接地址 - 源创会结束后图文回顾链接地址 【深圳】第1期】- 图文回顾【广州】第2期】- 图文回顾【北京】第3期】- 图文回顾【珠海】第4期】- 图文回顾【深圳】第5期】- 图文回顾--------…

ionic + cordova+angularJs 搭建的H5 App完整版总结

为期半个月的项目实践开发&#xff0c;已完整告一段落&#xff0c;团队小组获得第一名&#xff0c;辛苦总算没有白费&#xff0c;想起有一天晚上&#xff0c;整个小组的人&#xff0c;联调到12点才从公司回去&#xff0c;真是心酸。这里总结一下&#xff0c;项目过程中遇到的问…

基础数据结构【三】————老鼠走迷宫问题————堆栈应用

假设&#xff1a;老鼠在一个二维地图中i行走&#xff0c;地图中大部分路径被墙阻断&#xff0c;无法前进。老鼠可以按照尝试错误的方法找到出口。只是&#xff0c;这只老鼠必须具备走错路时候就退回来&#xff0c;并且把走过的路记下来&#xff0c;避免下次走重复路&#xff0c…

eclipse Debug中step into功能失灵的问题

step into 和 step over功能一样&#xff0c;无法进入方法内部&#xff0c;解决方法如下&#xff1a; 需要使用jdk中的jre&#xff0c;而不是独立安装的jre 再次Debug&#xff0c;当运行到断点的时候&#xff0c;点击step into&#xff08;F5&#xff09;就可以看见println函数…

Linux 基金会宣布红队项目,致力于孵化开源安全工具

百度智能云 云生态狂欢季 热门云产品1折起>>> 谁都想软件有着很高的安全性吧。毕竟&#xff0c;每一天都会有不一样的安全漏洞&#xff0c;从糟糕软件的沼泽中冒出来。 在近期举办的开源领导力峰会上&#xff0c;Linux 基金会宣布了新的红队项目&#xff08;Red Tea…

基础数据结构【四】————环形链表与多项式

主要演示环形列表节点的创建插入&#xff0c; 删除&#xff0c;遍历&#xff0c;环形链表连接 。双向链表节点的建立与插入 &#xff0c;双向链表中节点的删除 以及环形链表在多项式中的应用 DEMO1:环形链表节点的创建与插入 /* [名称]:ch03_08.cpp [示范]:环形链表节点的创…

关联scala源码

首先需要去官网下载sources 将下载好的压缩包拷贝到scala安装的lib目录下&#xff0c;解压 ctrlb以后 查看源码, 选择要查看的方法或者类, 输入 ctrl b import scala.io.StdIn 如果想看StdIn的源码&#xff0c;则将光标放在StdIn处&#xff0c;ctrlb 如果想查看io包下的内容&…

MySQL安装使用的2个问题

问题:1.遇到不输入密码能登上 ,使用密码报错.2.(解压版的) 在cmd输入>mysql –u root –p 时&#xff0c;按enter回车时&#xff0c;会叫你输入密码Enter password____,否则出现错误&#xff1a;ERROR 1045(28000):Access denied for user’root’’localhost’(using passw…

Flink1.7.2 sql 批处理示例

Flink1.7.2 sql 批处理示例 源码 https://github.com/opensourceteams/flink-maven-scala概述 本文为Flink sql Dataset 示例主要操作包括:Scan / Select,as (table),as (column),limit,Where / Filter,between and (where),Sum,min,max,avg,(group by ),group by having,disti…

ISP 【一】————boost标准库使用——批量读取保存文件 /boost第三方库的使用及其cmake添加,图像gramma

CMakeLists.txt文件中需要添加第三方库&#xff0c;并企鹅在CMakeLists.txt中添加 include_directories(${PROJECT_SOURCE_DIR}/../3party/gflags-2.2.2/include) link_directories(${PROJECT_SOURCE_DIR}/../3party/boost-1.73.0/lib-import) target_link_libraries( gram…

简单ajax类, 比较小, 只用ajax功能时, 可以考虑它

忘了哪儿转来的了, 不时的能够用上, 留存一下<script language"javascript" type"text/javascript"> /***var ajaxAjax();/*get使用方式* /ajax.get("php_server.php?id1&namexxx", function(data){ alert(data); //d…

Hadoop 三大发行版本

Hadoop三大发行版本&#xff1a;Apache、Cloudera、Hortonworks。 Apache版本最原始&#xff08;最基础&#xff09;的版本&#xff0c;对于入门学习最好。 Cloudera在大型互联网企业中用的较多。 Hortonworks文档较好。 1. Apache Hadoop 官网地址&#xff1a;http://had…

MongoDB主动撤回SSPL的开源许可申请

2018年10月&#xff0c;MongoDB将其开源协议更换为SSPL&#xff0c;虽然在当时引起了很大的争议&#xff0c;但是MongoDB始终坚信SSPL符合符合开源计划的批准标准&#xff0c;并向Open Source Initiative &#xff08;以下简称OSI&#xff09;提交了申请。不过&#xff0c;近日…

MATLAB【八】———— matlab 读取单个(多个)文件夹中所有图像

0.matlab 移动&#xff08;复制&#xff09;文件到另一个文件夹 sourcePath .\Square_train; targetPath .\Square_test; fileList dir(sourcePath); for k 3 :5: length(fileList) movefile([sourcePath,\,fileList(k).name],targetPath); end %copyfile([sourcePat…

JAVA IO学习

2019独角兽企业重金招聘Python工程师标准>>> 很多初学者接触IO时&#xff0c;总是感觉东西太多&#xff0c;杂乱的分不清楚。其实里面用到了装饰器模式封装&#xff0c;把里面的接口梳理一下之后&#xff0c;就会觉得其实蛮清晰的 相关的接口和类 接口或类描述Input…

Java面向对象三大特征 之 多态性

1、理解多态性&#xff1a;可以理解为一个事物的多种形态 2、对象的多态性&#xff1a;父类的引用指向子类的对象&#xff08;子类的对象赋给父类的引用&#xff09; 3、多态的使用&#xff1a;虚拟方法的调用 子类中定义了与父类同名同参数的方法&#xff08;重写&#xff…

Bootstrap3基础 btn-group-vertical 按钮组(横着、竖着排列)

内容参数OS Windows 10 x64 browser Firefox 65.0.2 framework Bootstrap 3.3.7 editor Visual Studio Code 1.32.1 typesetting Markdowncode <!DOCTYPE html> <html lang"zh-CN"><head><meta charset&quo…

ISP【二】————camera ir图

1. 加串解串芯片作用&#xff1f; A: 加串和解串是成对出现的&#xff0c;串行器在模组内&#xff0c;将并行信号转换为串行信号&#xff0c;然后用一根线可以实现远距离传输。sensor输出的raw data如果不加串&#xff0c;需要&#xff18;根线传输&#xff0c;很难传输很远&a…

Hadoop运行模式 之 本地运行模式

Hadoop的运行模式包括&#xff1a;本地模式、伪分布式模式以及完全分布式模式 Hadoop官网地址&#xff1a;https://hadoop.apache.org/ 本次使用的Hadoop的版本是2.7.2 官网文档&#xff1a;https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/Single…

一些使用Vim的小技巧

7.增加注释&#xff08;一个操作应用在多行&#xff09;比如需要增加#或者是//这种注释&#xff1a;Ctrl v 定位到开始行&#xff0c;然后选定需要的行&#xff0c;然后执行 I命令&#xff0c;然后输入 # 或 //&#xff0c;然后按 Esc键两次&#xff0c;即可把注释操作应用到所…

SpringBoot注解大全 转

2019年3月17日22:30:10 一、注解(annotations)列表 SpringBootApplication&#xff1a;包含了ComponentScan、Configuration和EnableAutoConfiguration注解。其中ComponentScan让spring Boot扫描到Configuration类并把它加入到程序上下文。 Configuration 等同于spring的XML配置…

MATLAB【九】————ICP算法实现

1.ICP推导与求解 https://zhuanlan.zhihu.com/p/35893884 2.算法实现&#xff1a; % 程序说明&#xff1a;输入data_source和data_target两个点云&#xff0c;找寻将data_source映射到data_targe的旋转和平移参数 clear; close all; clc; %% 参数配置 kd 1; inlier_ratio …

Centos 7环境下源码安装PostgreSQL数据库

马上就要去实习了&#xff0c;工作内容是搞数据仓库方面的&#xff0c;用的是postgresql关系型数据库&#xff0c;于是自己先来了解下这种数据的用法&#xff0c;之后说说这个数据库和MySQL的关系和区别。 1.Postgresql简介 看了下官网上的介绍&#xff0c;全球最高级的开源关系…

Oracle job procedure 存储过程定时任务

Oracle job procedure 存储过程定时任务 oracle job有定时执行的功能&#xff0c;可以在指定的时间点或每天的某个时间点自行执行任务。 一、查询系统中的job&#xff0c;可以查询视图 --相关视图 select * from dba_jobs; select * from all_jobs; select * from user_jobs; -…

Hadoop运行模式 之 伪分布式运行模式

什么是伪分布式模式&#xff1f;它与本地运行模式以及完全分布式模式有什么区别&#xff1f; 伪分布式的配置信息&#xff0c;完全是按照完全分布式的模式去搭建的&#xff0c;但是它只有一台服务器&#xff0c;可以用于学习和测试&#xff0c;真正的开发中不可以使用。 目录…

【C++】【一】结构体数组

demo7:函数份文件编写 swap.h #include <iostream> using namespace std;//函数的声明 void swap(int a, int b); swap.cpp #include "swap.h"//函数的定义 void swap(int a, int b) {int temp a;a b;b temp;cout << "a " << a …

Message、Handler、Message Queue、Looper之间的关系

2019独角兽企业重金招聘Python工程师标准>>> 在单线程模型下&#xff0c;为了解决线程通信问题&#xff0c;Android设计了一个通信机制。Message Queue(消息队列)&#xff0c; 线程间的通信可以通过Message Queue、Handler和Looper进行信息交换。下面将对它们进行逐…

在linux中只将“桌面”修改成“Desktop”而系统仍然使用中文

在安装好centos系统以后&#xff0c;它的Desktop&#xff0c;Downloads等文件夹都是中文的&#xff0c;桌面&#xff0c;下载等&#xff0c;这样在使用cd命令时特别不方便 解决方法一&#xff1a;下载一个中文输入法&#xff0c;安装 解决方法二&#xff1a; 修改il8n文件&a…