TAILIEUCHUNG - Thuật toán Algorithms (Phần 36)

Tham khảo tài liệu 'thuật toán algorithms (phần 36)', khoa học tự nhiên, toán học phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | RANGE SEARCHING 343 adapting to the point set at hand. 2D Trees Two-dimensional trees are dynamic adaptable data structures which are very similar to binary trees but divide up a geometric space in a manner convenient for use in range searching and other problems. The idea is to build binary search trees with points in the nodes using the y and x coordinates of the points as keys in a strictly alternating sequence. The same algorithm is used for inserting points into 2D trees as for normal binary search trees except at the root we use the y coordinate if the point to be inserted has a smaller y coordinate than the point at the root go left otherwise go right then at the next level we use the coordinate then at the next level the y coordinate etc. alternating until an external node is encountered. For example the following 2D tree is built for our sample set of points The particular coordinate used is given at each node along with the point name nodes for which the y coordinate is used are drawn vertically and those for which the x coordinates is used are drawn horizontally. 344 CHAPTER 26 This technique corresponds to dividing up the plane in a simple way all the points below the point at the root go in the left subtree all those above in the right subtree then all the points above the point at the root and to the left of the point in the right go in the left of the right of the root etc. Every external node of the tree corresponds to some rectangle in the plane. The diagram below shows the division of the plane corresponding to the above tree. Each numbered region corresponds to an external node in the tree each point lies on a horizontal or vertical line segment which defines the division made in the tree at that point. For example if a new point was to be inserted into the tree from region 9 in the diagram above we would move left at the root since all such points are below A then right at B since all such points are to the right of B then right at J since all .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.