[容易]合并排序数组 II
题目来源:http://www.lintcode.com/zh-cn/problem/merge-sorted-array/
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqQAAAHpCAIAAADbCrnRAAAgAElEQVR4nO2d224bV56v52X8AHkQZ8MXDV909wPMdFswgUBAEORWQFQXQVoe5GI0u0ETEeDkwpKQjdhgT7cNuG232m0N6Ggc25OxhLGoshRLlmWLJimK+6JO61gHimTRi9+HX3cssk6rWKpv/VdVUf/UBwAAAHfZOzj+p7K3AQAAAEYIsgcAAHAcZA8AAOA4yB4AAMBxkD0AAIDjDCT73dtXPv9242wrbtQqlUrFq/t5pjRP1qhVag39Zb/uqTMILzVqFeNcRVZsmlJfaOqaGrV8jQcAAOfZWTn53ae9nRGuYRDZb3z7+eeff37l9u7Aa/XrXiUgW3i+36h7Fc2bft2rVDyvrtt0WLL3/XpNX69A0hlIFpq85tc967x+3RMXnOwOBboDAADTwIOT3/26+7tfn9xsjmgFxWW/e/vK51e+/fbK5wMX941a5LFGuk2VWYQJ0wrjgWQfDDTkxav7/b7v+5HQg4WGCvd937wV1i00Tpu2AHN3IeeABQAATBih7Efn+8Ky3/g2sPzGt4MV94np+/1+VKAbnFbMvoHplArZqzeEFwTZK7NFLw9eR+s9CGOxHk4iV/9hLwHZAwBMKb0/hqbv/u7X3d/9a28Eqygo+93bVyLF794uXNz7pvH4HPW9qRq3D8cPXNkH9bptSF3pNKT0RmoNZQxf2iJhA6LXkT0AwJSS1PRxTv5z+KvJln1whT4h8bv9HQOBRNMGtu1qG6fsbYRuN0wTdg/EhSrDF8I6xfXELw9wzR7ZAwB88BhMP6KR/HTZ796+kkfkifaNA/thQV9Pr5nDQXeTsUqQvbQQg87F+Sqe54nj9OHkkuzN4wFKhZ/VDOVdZA8A8OHS7M0ZTF+K7PuR77OG6ze+tZm+4MVwo7UGkr1fr9XrNbEzYbhmHy9Bk70fzhuK3Cp6ww16dS/ouETzmO7Llx7rQ/YAANPGf/6r0fSlDeP301Se5+2zU1z2F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VvdBq7f6uPWgzzV7AAD3GY7sf0huvpPvxj++/k00Hh7PkugweSvuH4R3uX8TDwlE836zs6V0IEZ1zX68G5Mh+7B8j3Qe/LjZ7fd7zWToPrxs/2AzvbLvR3fyv1ttBTfuJQ/yIXsAAIcZeWX/w746rB3rMHl4/fmVH+JaOZr4h/1O9/j+k2Np9uAqQDhOMCLZj3dj0hUblPKfxbJ/HD1Kt956kBg6cHz366zKnufsAQCmk2Fcs5c8pw3jP76+G/UG5JvYteVE31gnPKP/m/iSf3Jzn+1betSbAAaU/Zg3Jl2xXx8Ij9dvmh7DCwt04eF7Bbvsg5v1kmmQPQCAo/Dd+CVvTMYw/sRkhMcgAACMGGSP7JE9AIDjIHtkj+wBABwH2SN7ZA8A4DgZsv/3Hy+V7sWh5P/+eGlyGiVuzMyPb0sXeWZmfnw7wmMQAABGTIbs/9q8Vrqnh5K7zWuT0yhxY64126W7PDPfNtsjPAYBAGDEZMi+d3ry1+a1f3v0z6XbeuD826N//mvzWu/0ZBIapW/MyWn/WrP9L48mtL7/l0dvrzXbJ6cjPAQBAGDUZMgeAAAAPnSQPQAAgOMgewAAAMfZOzj+/wjGLloiiOHHAAAAAElFTkSuQmCC" alt="" />
C++版 VS2012测试通过
//#include <iostream>
//#include <vector>
//using namespace std; 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
vector<int> v;
int i=,j=,k=;
while(i<m && j<n)
{
if(A[i]<B[j])
v.push_back(A[i++]);
else
v.push_back(B[j++]);
}
while(i<m)
v.push_back(A[i++]);
while(j<n)
v.push_back(B[j++]);
vector<int>::iterator it;
for(it=v.begin();it<v.end();it++)
A[k++]=*it;
}
}; //测试
//int main()
//{
// Solution s;
//
// int a[5]={1,2,4};
// int b[2]={3,5};
// s.mergeSortedArray(a,3,b,2);
// for(int i=0;i<5;i++)
// cout<<a[i]<<" ";
//}
Python2.7版 spider测试通过
class Solution:
"""
@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
"""
def mergeSortedArray(self, A, m, B, n):
# write your code here
i, j, index = m - 1, n - 1, m + n - 1
while i >= 0 and j >= 0:
if A[i] > B[j]:
A[index] = A[i]
index, i = index - 1, i - 1
else:
A[index] = B[j]
index, j = index - 1, j - 1
while i >= 0:
A[index] = A[i]
index, i = index - 1, i - 1
while j >= 0:
A[index] = B[j]
index, j = index - 1, j - 1 #测试
#if __name__=="__main__":
# s=Solution()
# a=[1,2,4,0,0]
# b=[3,5]
# s.mergeSortedArray(a,3,b,2)
[容易]合并排序数组 II的更多相关文章
- lintcode:合并排序数组 II
题目: 合并排序数组 II 合并两个排序的整数数组A和B变成一个新的数组. 样例 给出A = [1, 2, 3, empty, empty] B = [4,5] 合并之后A将变成[1,2,3,4,5] ...
- LintCode之合并排序数组II
题目描述: 分析:题目的意思是把数组A和数组B合并到数组A中,且数组A有足够的空间容纳A和B的元素,合并后的数组依然是有序的. 我的代码: public class Solution { /* * @ ...
- 6. 合并排序数组 II
6. Merge Two Sorted Arrays Description Merge two given sorted integer array A and B into a new sorte ...
- LintCode——合并排序数组II
描述:合并两个排序的整数数组A和B变成一个新的数组 样例:给出A=[1,2,3,4],B=[2,4,5,6],返回 [1,2,2,3,4,4,5,6] 1.Python:先将数组B加到数组A之后,然后 ...
- [LintCode] 合并排序数组II
class Solution { public: /** * @param A: sorted integer array A which has m elements, * but size of ...
- lintcode-64-合并排序数组 II
64-合并排序数组 II 合并两个排序的整数数组A和B变成一个新的数组. 注意事项 你可以假设A具有足够的空间(A数组的大小大于或等于m+n)去添加B中的元素. 样例 给出 A = [1, 2, 3, ...
- lintcode 中等题:搜索旋转排序数组II
题目 搜索旋转排序数组 II 跟进“搜索旋转排序数组”,假如有重复元素又将如何? 是否会影响运行时间复杂度? 如何影响? 为何会影响? 写出一个函数判断给定的目标值是否出现在数组中. 样例 给出[3, ...
- lintcode:合并排序数组
题目: 合并排序数组 合并两个排序的整数数组A和B变成一个新的数组. 样例 给出A=[1,2,3,4],B=[2,4,5,6],返回 [1,2,2,3,4,4,5,6] 挑战 你能否优化你的算法,如果 ...
- lintcode-63-搜索旋转排序数组 II
63-搜索旋转排序数组 II 跟进"搜索旋转排序数组",假如有重复元素又将如何? 是否会影响运行时间复杂度? 如何影响? 为何会影响? 写出一个函数判断给定的目标值是否出现在数组中 ...
随机推荐
- delphi中如何将string类型的字符串数据转化成byte[]字节数组类型的数据
var S:String; P:PChar; B:array of Byte;begin S:='Hello'; SetLength(B,Length(S)+1); P:=PChar(S) ...
- 查询执行慢的SQL
--执行慢的SQL: SELECT S.SQL_TEXT, S.SQL_FULLTEXT, S.SQL_ID, ROUND(ELAPSED_TIME / 1000000 / (CASE WHEN (E ...
- dedecms调用文章发布日期
<span>[field:pubdate function="MyDate('m-d',@me)"/]</span>
- Mac搭建python环境
1 安装xcode 2 安装 brew ruby-e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/mast ...
- MFC MFC对话框滚动条的使用
对话框的(上下/左右)滚动事件,比如,把一个比较大的对话框放入tab控件的某一页时,就需要添加滚动条.在使用了java和qt等图形界面化的集成开发环境之后,再使用MFC,就会发现,想要让一个对话框 ...
- 英语词组instead of的用法
nstead of 是个短语介词.Instead of 的意思是“代替……”.“而不……”, 在语言的实际运用中,instead o功能与连词十分相似,现归纳如下: 1.跟名词:I give him ...
- 【重点突破】——第三方绘图工具FusionCharts.js的使用详解
一.引言 项目组中,经常会因为绘制图表的繁杂度,衡量会不会使用第三方绘图工具,如果自己做很困难,成本使用高于第三方绘图工具库,就会使用.很多人使用的是Chart.js,因为它是免费使用的,不过,缺点就 ...
- 2017.3.14 activiti实战--第二十章--REST服务
学习资料:<Activiti实战> 第二十章 REST服务 20.1 通信协议概述 略. 20.2 REST API概述 资源分类 资源基础URI 说明 Deployments manag ...
- haifeng
[root@localhost 桌面]# yum list|grep wubi ibus-table-chinese-wubi-haifeng.noarch -.el7 base ibus-table ...
- Redis性能调优建议
一. Redis部署结构优化建议 1. Master不做AOF或RDB持久化,Slave做AOF持久化,建议同时做RDB持久化 2. 所有Master全部增加Slave 3. Master挂载Slav ...