Hacker News new | past | comments | ask | show | jobs | submit login

Sorting an array of pointers is sorting by numbers.



Sure, but what use is that? You will have your objects sorted by the absolute value of their pointer. I guess this means you'll have your objects sorted by the order in which they are allocated in the heap. Cool, but not very useful.


You can do a sorted array of pointers and later check if a specific pointer is in it with binary search, etc.


Not in Java you can't.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: