摘要:
一、背景 略 二、代码 for(auto& it:vec){ if(&it==&vec.back()){ cout<<"is the last element of vec."<<endl } } 其实就是通过判断当前遍历的元素地址是否与vector中最后一个元素的地址相同,若相同那么就是最后一个元 阅读全文
摘要:
前言 使用快速排序算法思想,查找数组中的第k大的数。复杂度为 O ( n ) O(n) O(n)。 代码 #include <iostream> #include <vector> #include <algorithm> // find median using namespace std; in 阅读全文
摘要:
一、set定义 c++官方对set的定义如下: Set:Sets are containers that store unique elements following a specific order. Set:set是一类用来存储满足一定排序的独一元素的容器。 类模板如下: template < 阅读全文
摘要:
一、本文前提 已知欧拉公式为: e j θ = c o s θ + j ⋅ s i n θ e^{j\theta}=cos\theta+j\cdot sin\theta ejθ=cosθ+j⋅sinθ 傅里叶级数公式为: f ( t ) = ∑ n = − ∞ n = + ∞ C n ⋅ e j ⋅ 阅读全文
摘要:
一、题目 A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to cus 阅读全文