### Help Please!!! Need Help Programming Kanets ALgorithm

Here is the logical steps that I must program...so far I have programmed the sort in descending order I am having trouble figuring out how to split the original array into two new arrays for steps 2-5 can someone please help

step 1) sort the array of jobs

step 2) send first job to array B

step 3) send even numbered jobs to array B

step 4) send odd numbered jobs to array A

step 5) send the last job (if there is one) to array A

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106`` ``````#include #include #include using namespace std; //Prototypes void Sort(int * , unsigned); void split ( int *, unsigned ); //Initializing variables int ar[100],n,i, firstOdd, countA, countB; int A[100]; int B[100]; int main() //Main Function { cout<<"How many jobs are there? "; //Gets the size of the array cin>>n; cout<>ar[i]; } Sort(ar, n); cout<<"The numbers listed in descending order are: "; for(i=0;i

Thanks for all your help in advance!
Last edited on
Topic archived. No new replies allowed.