class Solution {
public:
/**
* @param A: sorted integer array A which has m elements,
* but size of A is m+n
* @param B: sorted integer array B which has n elements
* @return: void
*/
void mergeSortedArray(int A[], int m, int B[], int n) {
// write your code here
int pa = m - , pb = n - , p = m + n - ;
while (pa >= && pb >= ) {
if (A[pa] >= B[pb]) A[p--] = A[pa--];
else A[p--] = B[pb--];
}
while (pb >= ) A[p--] = B[pb--];
}
};

最新文章

  1. [普通平衡树treap]【学习笔记】
  2. Java 集合类详解
  3. codeforces 471C.MUH and House of Cards 解题报告
  4. javascript第一弹——对象
  5. C++-理解构造函数、析构函数执行顺序
  6. check windows return character
  7. Cocos2d-JS特效
  8. Flume NG中的Kafka Channel
  9. 微信小程序,前端大梦想(七)
  10. pc网页到移动端怎么自动加载适应移动端的css。
  11. 微信连wifi认证
  12. printf 函数原型
  13. Kubernetes学习之路(26)之kubeasz+ansible部署集群
  14. 多线程-interrupt(),isInterrupted(),interrupted()(转)
  15. Linux内核配置.config文件
  16. C3P0连接池使用教程
  17. 51nod 1682 中位数计数(前缀和)
  18. Java多线程对同一个对象进行操作
  19. Java中的平衡树
  20. eclipse 打开的时候弹出 'Building workspace' has encountered a problem. Errors occurred during

热门文章

  1. mongodb - Master Slave Replication
  2. c语言中有bool型变量吗?
  3. asp.net mvc5 配置自定义路径
  4. (3)Smali系列学习之Smali语法详解
  5. Java序列化与反序列化学习(一)
  6. 221. Add Two Numbers II【medium】
  7. JS对象序列化为JSON对象的方法
  8. 【揭秘】什么是不对称秘钥和CA证书
  9. JFinal使用笔记3-注册和登录功能开发记录
  10. Switch选择语句能否作用在String【字符串】上,也就是能否这么写:Switch(一个字符串变量)?