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 ?
|
Newbie Member
|
|
| 13Oct2007,17:25 | #1 |
|
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 ? |
|
Go4Expert Founder
|
![]() |
| 13Oct2007,18:08 | #2 |
|
Just compare the X position.
|
|
Newbie Member
|
|
| 13Oct2007,18:24 | #3 |
|
that would be linear search..order N
i want it logn |
|
Team Leader
|
![]() |
| 13Oct2007,19:03 | #4 |
|
Heap sort will give you n log n.
|