A system and method for determining an extreme value of data in various applications including audio, video and image encoding schemes. The system and method are used to build a hierarchical data structure by partitioning the data values and then constructing a hierarchy using these data values, with the apex containing the extreme value. The system and method allow for changes in the data values in the base level of the hierarchy to ripple through to the apex in an efficient manner.