Sorting from match data

say I have person 1 to person 1024

Let's say
I want to sort them from smartest to dumbest

I have very few data say

person 1 is smarter than person 23
and so on

There are many missing data
say I don't know if person 30 is smarter or dumber than person 50

How to sort this kind of array ?
I definitely know it can't be sorted
but how can I sort this as best as possible from the few information I have

and also how to find how many more knowledge and also which knowledge to know correct order
Sorry, but you have already said:
rmxhaha wrote:

How to sort this kind of array ?
I definitely know it can't be sorted


You still asking?
It could be sorted so that it satisfies the data (x is smarter/dumber than y).
Last edited on
Is this one of those puzzle type things?

An insertion sort might be your must useful bet here...
@iQChange I am sorry the title is misleading but the perfect sort order is not the main point,

Not just a puzzle, I will use this for a few things
like determining what item does user would probably like

If I just insert everytime new data is provided
at some point I will make old data go wrong ?
I do on paper if I assume wrong then the order will sometimes go wrong too


I am thinking that I should sort again if new data is provided ? or shouldn't I ?

Is there more efficient data structure than array ?
Last edited on
Topic archived. No new replies allowed.