java example -- find intersection of orthogonal line segments with TreeSet and PriorityQueue

preview_player
Показать описание
We can find how many intersections of orthogonal line segments have with the help of binary search tree. Java collection framework provided good implementation of binary search tree. The TreeSet implementation of SortedSet is based on TreeMap, which is based on black-red binary search tree and we expect logN performance for large number of lines.

code used in the video
Рекомендации по теме
join shbcf.ru