[重新解答]阿里笔试:去重和排序,重新输出Markdown格式

在网上偶然看到一道题目,发现博主的答案有问题,所以重新解答一下题目 原题链接【https://blog.csdn.net/qq_29108585/article/details/60956567】 …

实现C++字符串的spilt

std::string mySplit(std::string src, uint8_t field ,char delim=' ') { std::stringstream ss(…

动态规划:硬币找零

硬币找零问题,我们在贪心算法那一节中讲过一次。我们今天来看一个新的硬币找零问题。假设我们有几种不同币值的硬币 v1,v2,……,vn(单位是元)。如果我们要支付 w 元,求最少需要多少个硬币。比如,…

动态规划:“杨辉三角”

动态规划题目: “杨辉三角”不知道你听说过吗?我们现在对它进行一些改造。每个位置的数字可以随意填写,经过某个数字只能到达下面一层相邻的两个数字。 设你站在第一层,往下移动,我们把移动到最底层所经过的…

c++11遍历打印tuple(借助模版参数)

#include <tuple> #include <iostream> using namespace std; // 由于std::get<size_t>(t…

STL list sort

#include <cstdio> #include <list> #include <iostream> using namespace std; typede…

玩转c++模板模板参数

#include <iostream> #include <vector> #include <deque> #include <ext/pool_alloc…

使用CAS实现单例模式

#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h&…

使用C语言内嵌汇编实现CAS

#include <stdio.h> #include <unistd.h> #include <pthread.h> #include <stdlib.h&…

c++11使用atomic多线程同步3种方法

// 使用CAS实现多线程无锁访问共享变量,达到线程同步 # include <iostream> # include <thread> # include <mutex…