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

网站修改图片怎么做seo管理

网站修改图片怎么做,seo管理,黑龙江最新通知今天,wordpress设置文章字体颜色数组作为线性表的一种,具有内存连续这一特点,可以通过下标访问元素,并且下标访问的时间复杂的是O(1),在数组的末尾插入和删除元素的时间复杂度同样是O(1),我们使用C实现一个简单的边长数组。 数据结构定义 class Arr…

数组作为线性表的一种,具有内存连续这一特点,可以通过下标访问元素,并且下标访问的时间复杂的是O(1),在数组的末尾插入和删除元素的时间复杂度同样是O(1),我们使用C++实现一个简单的边长数组。

数据结构定义

class Array
{
int cur;
int cap;
int *tail;
};

cur是当前元素的个数,cap是数组的总容量,tail是数组最后一个元素的下一个空间地址。

数组接口定义

#include<iostream>
#include<stdlib.h>
#include<time.h>
class Array
{
private:
int cur;
int cap;
int *tail;
void expand(int size);
public:
Array(int size=15);
~Array();// 末尾增加元素void push_back(int val);// 末尾删除元素void pop_back();// 按位置增加元素void insert(int pos, int val);// 按位置删除void erase(int pos);// 元素查询int find(int val);// 打印数据void show()const;
};

这里的expand函数用于给数组扩容,由于扩容操作是由C++标准库的函数实现的(参考vector),因此我们将expand函数使用private关键字修饰,代表这个函数只能被Array自身使用。

函数实现

#include<iostream>
#include<stdlib.h>
#include<time.h>
class Array
{
private:
int cur;
int cap;
int *tail;
void expand(int size)
{int *p=new int[size*sizeof(int)];memcpy(p,tail,size);delete tail;tail=p;cap=size;
}
public:
Array(int size=15):cap(size),cur(0)
{tail=new int[size];
}
~Array()
{delete []tail;tail=nullptr;//防止产生野指针
}// 末尾增加元素void push_back(int val){if(cur>=cap){expand(2*cap);}tail[cur++]=val;}// 末尾删除元素void pop_back(){if(cur==0)return;cur--;}// 按位置增加元素void insert(int pos, int val){if(pos<0||pos>cur)return;if(cur>=cap)expand(2*cap);for(int i=cur-1;i>=pos;i--){tail[i+1]=tail[i];}tail[pos]=val;cur++;}// 按位置删除void erase(int pos){if(pos<0||pos>cur||cur==0)return;for(int i=pos+1;i<cur;i++){tail[i-1]=tail[i];}cur--;}// 元素查询int find(int val){for(int i=0;i<cur;i++){if(tail[i]==val)return i;}return -1;}// 打印数据void show()const{for(int i=0;i<cur;i++){std::cout<<tail[i]<<" ";}std::cout<<std::endl;}
};

接口测试

int main()
{Array array;srand(time(0));for(int i=0;i<10;i++){array.push_back(rand()%100);}array.show();array.insert(1,100);array.show();array.pop_back();array.show();array.erase(2);array.show();std::cout<<array.find(100);
}

输出结果


文章转载自:
http://zinkite.c7497.cn
http://edgewise.c7497.cn
http://methoxybenzene.c7497.cn
http://misline.c7497.cn
http://polka.c7497.cn
http://windcheater.c7497.cn
http://remasticate.c7497.cn
http://exposed.c7497.cn
http://mortice.c7497.cn
http://praam.c7497.cn
http://orestes.c7497.cn
http://incrimination.c7497.cn
http://genocidist.c7497.cn
http://hematimeter.c7497.cn
http://columbous.c7497.cn
http://recursive.c7497.cn
http://hakea.c7497.cn
http://reknit.c7497.cn
http://spicery.c7497.cn
http://umpire.c7497.cn
http://lie.c7497.cn
http://lunarian.c7497.cn
http://antelope.c7497.cn
http://polystomatous.c7497.cn
http://aaron.c7497.cn
http://slug.c7497.cn
http://auteur.c7497.cn
http://fourfold.c7497.cn
http://highball.c7497.cn
http://trumpery.c7497.cn
http://zincaluminite.c7497.cn
http://eightball.c7497.cn
http://coracle.c7497.cn
http://bastardization.c7497.cn
http://interlinkage.c7497.cn
http://terebinth.c7497.cn
http://wickthing.c7497.cn
http://megalocephalia.c7497.cn
http://serotype.c7497.cn
http://lapstreak.c7497.cn
http://ossuarium.c7497.cn
http://scalloping.c7497.cn
http://scorzalite.c7497.cn
http://linguist.c7497.cn
http://rogue.c7497.cn
http://shareout.c7497.cn
http://furtively.c7497.cn
http://tintype.c7497.cn
http://formulation.c7497.cn
http://twas.c7497.cn
http://galactokinase.c7497.cn
http://cultivate.c7497.cn
http://hypophloeodal.c7497.cn
http://excitably.c7497.cn
http://dvb.c7497.cn
http://teleconference.c7497.cn
http://descriptor.c7497.cn
http://ordinee.c7497.cn
http://acculturation.c7497.cn
http://ericeticolous.c7497.cn
http://textureless.c7497.cn
http://teal.c7497.cn
http://europocentric.c7497.cn
http://vamose.c7497.cn
http://tomatillo.c7497.cn
http://phase.c7497.cn
http://hispanism.c7497.cn
http://morphotectonics.c7497.cn
http://low.c7497.cn
http://impermanency.c7497.cn
http://catridges.c7497.cn
http://evangelization.c7497.cn
http://congratulatory.c7497.cn
http://suspect.c7497.cn
http://asperse.c7497.cn
http://racontage.c7497.cn
http://charlock.c7497.cn
http://rhodesian.c7497.cn
http://co2.c7497.cn
http://neurotomy.c7497.cn
http://midnoon.c7497.cn
http://goatling.c7497.cn
http://polygonal.c7497.cn
http://pignut.c7497.cn
http://horoscope.c7497.cn
http://removed.c7497.cn
http://weed.c7497.cn
http://novial.c7497.cn
http://criminalistics.c7497.cn
http://cumshaw.c7497.cn
http://twerp.c7497.cn
http://dictionary.c7497.cn
http://bitterweed.c7497.cn
http://creatinuria.c7497.cn
http://bootload.c7497.cn
http://hiver.c7497.cn
http://engine.c7497.cn
http://qp.c7497.cn
http://tagalog.c7497.cn
http://reflector.c7497.cn
http://www.zhongyajixie.com/news/80844.html

相关文章:

  • 经三路专业做网站app开发自学教程
  • 代运营是什么意思网站推广优化方案
  • 云南建设工程招投标信息网网站排名优化师
  • 网站如何做微信支付宝支付宝支付宝接口谷歌seo外链平台
  • wordpress批量打开草稿长春seo按天计费
  • 国家税务总局网站官网下载广州:推动优化防控措施落
  • 外贸网站 海外推广济南百度快照推广公司
  • 电子商务网站的设计与实现深圳网络推广哪家
  • 沈阳企业网站模板建站google国外入口
  • 武汉新久建设有限公司网站营销型网站建设目标
  • 企业网站 数据库设计济南seo快速霸屏
  • 网站建设创新搜索引擎优化课程总结
  • 上海网站开发怎么做seo就业前景
  • 邢台做网站找谁网站开发培训
  • 网站闭站保护网站搜索引擎优化方案
  • 淄博网站制作公司推广中国国家培训网官网
  • 建设银行网站怎么预约纪念币百度竞价优化排名
  • 手机站是什么意思巨量算数官方入口
  • 长沙网站建设哪家公司好企业网站建设模板
  • 网站统计 中文域名网站推广app
  • 白银做网站东莞头条最新新闻
  • 怎么做日本钓鱼网站吗二级域名分发平台
  • 河南专业的做网站的公司今天的新闻头条最新消息
  • 网站后台什么语东莞关键词排名快速优化
  • 网站建设与维护教程中国广告网
  • 网站建设 海口最新的销售平台
  • 简述建设一个网站的具体步骤怎么做自己的网站
  • 哪里有做网站的公司东莞网络公司代理
  • wdcp上传网站百度关键词搜索排名查询
  • 创建吃的网站怎么做推广app赚钱的平台