I'm trying to build object that contaions list (Node) of the object priority (private int prio, private String data). the list nust be sorted (the lowest priority at the start, the highest at the end). I'm working with java-eclipse. my insert method doesn't work and I dont know why. I would be glad if somone can show me how this method should be done.
I need to do the same thing with array of priority, but I assume that this is the same idea.
Thank you very nuch.
Asked
Active
Viewed 64 times
0

Manfred Radlwimmer
- 13,257
- 13
- 53
- 62

omere
- 1
- 1
-
2If would be nice if you have use code formatting and improve your wording for better understanding. – Ravi Chandra Apr 20 '17 at 13:11
-
Your question is somewhat similar to this http://stackoverflow.com/questions/5805602/how-to-sort-list-of-objects-by-some-property – Ravi Chandra Apr 20 '17 at 13:14
-
I do not know how to format my code – omere Apr 20 '17 at 13:41
-
@omere How to format the code is well documented here https://meta.stackoverflow.com/questions/251361/how-do-i-format-my-code-blocks – Pung Worathiti Manosroi Apr 20 '17 at 15:05