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

做网站公司赚钱吗seo内容优化心得

做网站公司赚钱吗,seo内容优化心得,简洁大方网站建设,网站建设机构算法简介: sort // 对容器内元素进行排序reandom_shuffle // 洗牌 指定范围内的元素随机调整次序merge // 容器元素合并,并存储到另一个容器中reverse // 反转指定范围的元素 1. sort 功能描述: 对容器内元素进行排序 函…

算法简介:

  • sort       // 对容器内元素进行排序
  • reandom_shuffle    // 洗牌 指定范围内的元素随机调整次序
  • merge     // 容器元素合并,并存储到另一个容器中
  • reverse     // 反转指定范围的元素

1. sort

  • 功能描述:
    • 对容器内元素进行排序
  • 函数原型:
sort(iterator beg, iterator end, _Perd);

        // beg 开始迭代器

        // end 结束迭代器    

        // _Pred 谓词 

  • 示例:
#include<iostream>
using namespace std;
#include <vector>
#include <algorithm>
#include <string>
#include <functional>// 常用排序算法 sort
void myPrint(int val){cout << val << " ";
}void test01(){vector<int>v;v.push_back(10);v.push_back(30);v.push_back(50);v.push_back(20);v.push_back(40);// 利用sort进行升序sort(v.begin(),v.end());for_each(v.begin(),v.end(),myPrint);cout << endl;// 降序sort(v.begin(),v.end(),greater<int>());for_each(v.begin(),v.end(),myPrint);cout << endl;
}int main(){test01();return 0;
}
// 10 20 30 40 50
// 50 40 30 20 10

2. random_shuffle

  • 功能描述
    • 洗牌:指定范围内的元素随机调整次序
  • 函数原型:
random_shuffle(iterator beg, iterator end);

        //beg 开始迭代器

        //end 结束迭代器 

  • 示例:
#include<iostream>
using namespace std;
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <ctime>
// 常用排序算法 random_shuffle
void myPrint(int val){cout << val << " ";
}
void test01(){vector<int>v;for (int i = 0; i < 10; i++){v.push_back(i);}random_shuffle(v.begin(),v.end());for_each(v.begin(),v.end(),myPrint);cout << endl;
}int main(){srand((unsigned int)time(NULL));test01();return 0;
}

3. mrege

  • 功能描述:
    • 两个容器合并,并存储到另一个容器中
  • 函数原型:
merge(iterator beg1, iterator end1, iterator beg2, iterator end2, iterator dest);

        // 注意:两个容器必须是有序的

        // beg1 容器1开始迭代器

        // end1 容器1结束迭代器

        // beg2 容器2开始迭代器

        // end2 容器2结束迭代器

        // dest 目标容器开始迭代器 

  • 示例:
#include<iostream>
using namespace std;
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
// 常用排序算法 merge
void myPrint(int val){cout << val << " ";
}
void test01(){vector<int>v1;vector<int>v2;for (int i = 0; i < 10; i++){v1.push_back(i);v2.push_back(i+1);}vector<int>vTarget;vTarget.resize(v1.size() + v2.size());merge(v1.begin(), v1.end(), v2.begin(), v2.end(), vTarget.begin());for_each(vTarget.begin(),vTarget.end(),myPrint);cout << endl;
}int main(){test01();return 0;
}
//0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10

 4. reverse

  • 功能描述:
    • 将容器内元素进行反转
  • 函数原型:
reverse(ierator beg, iterator end);

        // beg 开始迭代器

        // end 结束迭代器 

  • 示例:
#include<iostream>
using namespace std;
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
// 常用排序算法 reverse
class myPrint
{
public:void operator()(int val){cout << val << " ";}
};
void test01(){vector<int>v;v.push_back(10);v.push_back(30);v.push_back(50);v.push_back(20);v.push_back(40);cout << "反转前:" << endl;for_each(v.begin(),v.end(),myPrint());cout << endl;cout << "反转后" << endl;reverse(v.begin(), v.end());for_each(v.begin(),v.end(),myPrint());cout << endl;
}
int main(){test01();return 0;
}
// 反转前:
// 10 30 50 20 40
// 反转后:
// 40 20 50 30 10

http://www.dtcms.com/wzjs/246540.html

相关文章:

  • 网站开发中为什么有两个控制层搜索引擎快速排名推广
  • 国产99做视频网站营销策略理论
  • 珠海网站制作公友妙招链接怎么弄
  • java可以做微信网站么磁力宝最佳搜索引擎入口
  • 电子商务网站管理百度云官网登录入口
  • wordpress阅读次数自动增长平台关键词排名优化
  • wordpress轮播全屏小红书关键词优化
  • 青岛公司网站建设公司百度人工客服电话是多少
  • 如题,HTML如何将两张图片_一张放在网站顶部做背景,另一张放在尾部做背景?seo软件哪个好
  • 朝阳区网站建设网络营销毕业论文范文
  • 专题网站建设策划数据分析师
  • 网站建设误区图长沙谷歌优化
  • 网站开发 团队协作网络推广营销技巧
  • wordpress商店如何添加商品东莞百度快速优化排名
  • 长春建站网站模板网络营销软文
  • 做网站要注意些什么要求seo排名外包
  • 网站建设首页该放什么seo优化标题
  • 网站设计行业吃香么百度怎么免费推广
  • 郑州高端网站建设seo关键词优化的技巧和方法
  • 怎么用ps做简单网站适合seo软件
  • 广州定制网站建设公司电商运营推广的方式和渠道有哪些
  • 做商贸生意的人都去什么网站网站设计与开发
  • 贵州网站建设设计公司哪家好网络推广引流最快方法
  • 定制网站建设官网百度站长工具网站
  • 建设网站用什么软件网站seo优化技能
  • 什么网站做软件任务挣钱网站创建公司
  • 长沙房地产市场情况分析百度seo培训要多少钱
  • 自己网站上做淘宝搜索广东搜索引擎优化
  • wordpress模板 户外钓鱼类网站百度的营销推广
  • wordpress最大上传2gseo咨询