- Related Questions & Answers
- Policy-based data structures in g++
- Kernel Data Structures
- Kinetic Data Structures
- Data objects and Structures
- Abstract Data Type in Data Structures
- Inbuilt Data Structures in C#
- Inbuilt Data Structures in Python
- Data Structures Stack Primitive Operations
- Tail Recursion in Data Structures
- Bernoulli Distribution in Data Structures
- Binomial Distribution in Data Structures
- Geometric Distribution in Data Structures
- Stack ADT in Data Structures
- Adjacency lists in Data Structures
- What are JavaScript data types and data structures?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Total and leaf correspondence are more sophisticated correspondence techniques. In both of these techniques, half the elements are located in the min PQ and the other half in the max PQ. When the number of elements is odd, one element is stored in a buffer. This buffered element is not the member of either PQ. In total correspondence technique, each element x in the min PQ is paired with a distinct element y of the max PQ. (x, y) is a corresponding pair of elements such that priority(x) <= priority(y).

Figure E displays a total correspondence heap for the 11 elements 3, 4, 5, 5, 6, 6, 7, 8, 9, 10, 11. The element 10 is in the buffer. Corresponding pairs are displayed by red arrows.

Figure E: Total correspondence heap

In leaf correspondence technique, each leaf element of the min and max PQ is needed to be part of a corresponding pair. Non-leaf elements do not require to be in any corresponding pair. Figure F displays a leaf correspondence heap.

Figure F: A leaf correspondence heap

Total and leaf correspondence structures need less space than dual structures. However, the DEPQ Algorithms for total and leaf correspondence structures are more complicated than those for dual structures. Of the three correspondence techniques, leaf correspondence is the fastest DEPQ correspondence structures.

Advertisements