actually , I am working on a project and i need to sort the co-ordinates in the increasing y value.
input: 1 2
like this, and i need to sort them in the increasing y value.
my approach: i think that i should store them in a struture having memebers x and y and sort them. but problem is i wana do this in nlogn by using quick sort or merge sort. and for quick making the code, i wana use the qsort() function already defined in the C. this function needs a compare() and array which we nned to sort. but problem is that i want to sort the array of structures on the basis of its one member which is y in this case. can you help me a little bit? thanks in advance.
Edited 4 Years Ago by nitin1