get maximum x of array of points

nicromonicon's Avatar, Join Date: Oct 2007
Newbie Member
Hey guys..so I have this array of points
Point[] arr = { new Point(0, 2),
new Point(1,0), new Point(3,0),
new Point(4,2), new Point(3,3) };
how can I determine the maximum X coordinate using order logn ?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Just compare the X position.
0
nicromonicon's Avatar, Join Date: Oct 2007
Newbie Member
that would be linear search..order N
i want it logn
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
Heap sort will give you n log n.