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

网站设计与开发培训网站开发源代码知识产权归属

网站设计与开发培训,网站开发源代码知识产权归属,怎样注册代理记账公司,如何推广自己的网站文章目录 大根堆 大根堆 这一篇中我会给出一个基于C模板实现的比较完善的heap类#xff0c;你只需要简单地修改就可以把它变为小根堆 #include iostream #include vector #include cmath using namespace std;templatetypename T class heap… 文章目录 大根堆 大根堆 这一篇中我会给出一个基于C模板实现的比较完善的heap类你只需要简单地修改就可以把它变为小根堆 #include iostream #include vector #include cmath using namespace std;templatetypename T class heap {// Big root heap public:vectorT data;size_t size;heap(){size 0;}heap(vectorT nums){// 99 5 36 7 22 17 46 12 2 19 25 28 1 92this-data nums;this-size nums.size() - 1;for (size_t i size / 2; i 1; i--) {siftdown(i);}}void siftup(size_t i){bool check false;if (i 1) return;else {while (i ! 1 !check) {if (this-data[i] this-data[i / 2]) {T temp this-data[i / 2];this-data[i / 2] this-data[i];this-data[i] temp;i / 2;}else check true;}}return;}void siftdown(size_t i){bool check false;size_t t 0;while (i * 2 this-size !check) {if (this-data[i] this-data[i * 2]) {t i * 2;}else t i;if (i * 2 1 this-size) {if (this-data[t] this-data[i * 2 1]) {t i * 2 1;}}if (t ! i) {T temp this-data[t];this-data[t] this-data[i];this-data[i] temp;i t;}else {check true;}}return;}T deletemin(){T temp this-data[1];this-data[1] this-data[this-size--];siftdown(1);return temp;}void addElement(T num){this-data.push_back(num);this-size;siftup(this-size);}void heap_sort(){heapT h_temp{ *this };while (h_temp.size 1) {cout h_temp.deletemin() ;}cout endl;}void heap_select(int m){if (m this-size-1) heap_sort();else {int cnt{ 0 };heapT h_temp{ *this };while (cnt m) {printf(%d , h_temp.deletemin());cnt;}printf(\n);}}bool empty(){if (this-size 0) return true;else return false;}templatetypename Ufriend ostream operator(ostream output, heapU h){size_t n 1;for (size_t i 1; i h.size; i) {output h.data[i] ;if (i n * 2 - 1) {output endl;n * 2;}}output endl;return output;} };这里没有给出对应的测试代码你可以自己写一个main函数来测试一下我的测试中它并没有出什么问题
http://www.zqtcl.cn/news/394078/

相关文章:

  • Soho外贸常用网站wordpress下不了插件吗
  • 企业网站建设小技巧有哪些WordPress网站小程序
  • 公司招聘网站续费申请seo编辑是干什么的
  • 58同城泉州网站建设人工投票平台app
  • dede 网站地图 插件网站引导页flash
  • 聊城做网站的公司渠道网站总体结构
  • 北京比较大的网站建设公司wap网站引导页特效
  • 做关于植物的网站即墨网站设计
  • 怎么提升网站收录商品网页制作
  • 做网站建设的平台wordpress5.0发布
  • 站长工具a级查网站域名
  • 免费做网站电话手机开发者模式打开有什么影响
  • 上海免费网站建站模板毕节做网站优化
  • 影响网站建设的关键点手机网站制作app
  • 商务网站建设的流程深圳模板网站建设案例
  • 做中英文网站多少钱方维制网站
  • 做一个信息发布网站要多少钱开发小程序多少钱一个
  • 山东网站设计网站关键词设置技巧
  • 做网站服务怎么赚钱产品展示型的网站功能有哪些
  • 丹东网站制作宁波网站建设公司制作网站
  • 南宁建设工程质量网站九江网站建设九江
  • 永州市住房和城乡建设厅网站服务器可以做几个网站
  • 哪里学网站建设与管理做移动端电影网站
  • 境外企业网站推广大冶市建设局网站
  • 户网站建设的不全.阿里巴巴国际站
  • 定制手机壳的网站能在家做的兼职的网站
  • 温州营销型网站建设郴州网络推广公司
  • asp.net 做网站源代码网站怎么做配置文件夹
  • 网站建设云尚网络wordpress首页flash
  • 北京优化网站宁波网络营销策划公司