You have unread notifications. Click here.

Merge Sort Code

Loading ...
Start Coding
using namespace std;
vector<int> merge(vector<int> a, vector<int> b){
-vector<int> r;
-int i=0,j=0;
-while(i<a.size() && j<b.size())
--else if(b[j]<=a[i])
-return r;
vector<int> msort(vector<int> x){
--return x;
-vector<int> a,b;
-int i;
-for(i=0; i<x.size()/2; i++)
-for(; i<x.size(); i++)
-a = msort(a);
-b = msort(b);
-return merge(a,b);
int main(){
-vector<int> x={5,2,7,4,9};
-x = msort(x);
-for(int i=0; i<x.size(); i++)


English Version
Show Advanced Exercises

Advanced Exercises


Answer the following questions according to what you learned from the video.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Comments & Feedback

ملحوظة يتم مراجعة التعليقات قبل ظهورها من قبل الإدارة. رجاء عدم كتابة نفس التعليق أكثر من مرة.
Back to Course