The problem of binary trie tree's XOR or maximum value

Source: Internet
Author: User

The trie tree can generally be used to find the closest to the specified value, and the binary trie tree can also find the value that is farthest from the specified value, that is, an XOR or maximum value, because each node has up to two child nodes.


CSU1216

(1) Question: Given an array, find two numbers in the array so that the difference or value of these two numbers is the largest

(2) point: For each element in the array, the binary trie tree looks for an XOR or maximum value. It should be noted that the CSU this wonderful flower can not call the Assert function, if any, will be directly re.


HRBUST1717

(1) Question: Given an array, find the maximum value of any prefix in this array and any one of the suffixes.

(2) Points: First insert each prefix into the trie tree, and then the maximum value of each suffix or

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.