【找工作】C++和算法复习(自用)

文章目录

自用随便记录

C++

排序

stl

头文件

全能头文件:

复制代码
#include<bits/stdc++.h>

自定义排序函数

复制代码
bool compare(const int &odd1,const int &odd2)
{
	return odd1>odd2;
}

stl

枚举map

c++ 复制代码
  map<int, string> mapStudent;  
  mapStudent.insert(pair<int, string>(1, "student_one"));  
  mapStudent.insert(pair<int, string>(2, "student_two"));  
  mapStudent.insert(pair<int, string>(3, "student_three"));  
  map<int, string>::reverse_iterator  iter;  
  for(iter = mapStudent.rbegin(); iter != mapStudent.rend(); iter++)  
  {  
     cout<<iter->first<<"   "<<iter->second<<endl;  
  }  

优先队列

算法

数据结构

树状数组

数学

快速幂

gcd和最小公倍数(ab的最小公倍数=ab/gcd(ab))

c 复制代码
int gcd(int x, int y){
    if(x<y) return gcd(y, x);
    return y == 0?x:gcd(y, x%y);
}

ex_gcd

质数

相关推荐
茉莉玫瑰花茶9 分钟前
floodfill 算法(dfs)
算法·深度优先
CoderCodingNo42 分钟前
【GESP】C++五级考试大纲知识点梳理, (5) 算法复杂度估算(多项式、对数)
开发语言·c++·算法
星河队长1 小时前
VS创建C++动态库和C#访问过程
java·c++·c#
MYX_3091 小时前
第三章 线型神经网络
深度学习·神经网络·学习·算法
沐怡旸2 小时前
【穿越Effective C++】条款02:尽量以const, enum, inline替换#define
c++·面试
坚持编程的菜鸟2 小时前
LeetCode每日一题——三角形的最大周长
算法·leetcode·职场和发展
给大佬递杯卡布奇诺3 小时前
FFmpeg 基本API avcodec_alloc_context3函数内部调用流程分析
c++·ffmpeg·音视频
QT 小鲜肉3 小时前
【个人成长笔记】Qt 中 SkipEmptyParts 编译错误解决方案及版本兼容性指南
数据库·c++·笔记·qt·学习·学习方法
看到我,请让我去学习3 小时前
Qt 控件 QSS 样式大全(通用属性篇)
开发语言·c++·qt
筱砚.3 小时前
【STL——vector容器】
开发语言·c++