Array sort help

 
Hi All,

I am a new coder since 2 months.

i want to ask a question. i want to ascending and descending sorting arrays according to condition. i found this example in mql4 documentation.

//--- example of sorting of one dimensional array
double num_array[5]={4,1,6,3,9};
//--- now array contains values 4,1,6,3,9
ArraySort(num_array);
//--- now array is sorted 1,3,4,6,9
ArraySort(num_array,WHOLE_ARRAY,0,MODE_DESCEND);
//--- now array is sorted 9,6,4,3,1

for instance i enter manually array values after that i want to get 2 array according to a contidition.

for above example. i want to ascending bigger than 5 and descending lower than 5

output
1 array values 6,9
2. array values 4,3,1

I looked everywhere but couldn't find any code like this. I would really appreciate if you can help
 
 
 
Put the values in two separate arrays and sort each.
 
William Roeder #:
Put the values in two separate arrays and sort each.
Oh thank you. This was newbie question Thank you for answering my question though.

I will search.  I'll seperate the value 50 first according to whether it is larger or smaller.  then i will array them and sort them.

Just a little newbie question. I plan to do that with if statement is it True. I thank you in advance for your interest.
 
You could also sort the array, find the highest value under, then sort the lower half descending. Not as efficient.