You have unread notifications. Click here.

Divide and Conquer 2

Loading ...
Start Coding
#include <iostream>
#include <vector>
using namespace std;
void conqure (vector<int> &x, int s1, int e1, int s2, int e2){
-vector<int> r;
-int s = s1;
-while(s1<=e1 && s2<=e2)
--if(x[s1]< x[s2])
-for(int i=0; i<r.size(); i++,s++)
--x[s] = r[i];
void divide(vector<int> &x, int s, int e){
-int s1 = s, e1 = (s+e)/2 ;
-int s2 = e1+1 , e2 = e;
-divide(x, s1, e1);
-divide(x, s2, e2);
-return conqure(x, s1, e1, s2, e2);
int main() {
-vector<int> x={4,3,9,8,6};
-for(int i=0; i<x.size(); i++)
-return 0;


English Version

. A program that  calculates the power using (a base number and an exponent)

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