QuickSort over a field of an Object

i have to do a QuickSort to create an Array of "Stones"my question is: i wanna make the QuickSort only over the "ValueySize" field witch is the result of "Value / Size" is there any way to get a sorted array of stones by valueYSize? Thanks in advance ;) public class Stone implements Comparable{ private float[] value; private float[] size; private float[] valueYSize; }
Do you mean to have an array of stones (like you say in your question) or an array of values inside the class Stone (as written in your code)?

以上就是QuickSort over a field of an Object的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准