Hi Guys

Ive come accross an interesting application which sorts out an array. Nothing special about that right? But then it gets a bit messy as it can sort out numerous array based on the original.

So Lets say I provide it with an Array of 4 number (3,4,1,2) and want it descending the output is (4,3,2,1) perfect.

Now if i provided it with another Array of 4 (7,5,8,9) I get (5,8,7,9).

So bit of a math probelm to solve guys.

How does 4,3,2,1 correlate with 5,8,7,9?

As part of the problem the code for the app is hidden so i cant provide any :(

Recommended Answers

All 6 Replies

No code? No real help. What language is the program written in?

Could you at least mention the application you're talking about?

I dont think the application is public. It was for a test I recently done.

It used a alot of familar command which resembled the .net framework, close to C# but not quite there.

It would appear the code doesn't sort at all. Can you please explain what you mean by

But then it gets a bit messy as it can sort out numerous array based on the original.

Well my initial solution what that that second array orders based on the original indexing of the first array. However you can pass it more than 2 arrays.

So if the first array had the value of 1 in index 3. this would move to index 0. Lets say the second array has the value of 5 in index 3, this would now move to index 0 despite potential having a higher value than other indexes.

This is not the case though

This is not the case though

It's not going to help to describe what it doesn't do. You'll have to provide more examples to show what it does do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.