Class BinaryHeapFormatter


  • public class BinaryHeapFormatter
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      protected static <E extends java.lang.Comparable<E>>
      org.insa.graphs.algorithm.utils.BinaryHeapFormatter.Context
      toStringLoop​(BinaryHeap<E> heap, org.insa.graphs.algorithm.utils.BinaryHeapFormatter.Context ctxt, int node, int max_depth)  
      static <E extends java.lang.Comparable<E>>
      java.lang.String
      toStringSorted​(BinaryHeap<E> heap, int max_elements)
      Creates a multi-lines string representing a sorted view of the given binary heap.
      static <E extends java.lang.Comparable<E>>
      java.lang.String
      toStringTree​(BinaryHeap<E> heap, int maxDepth)
      Creates a multi-lines string representing a tree view of the given binary heap.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BinaryHeapFormatter

        public BinaryHeapFormatter()
    • Method Detail

      • toStringLoop

        protected static <E extends java.lang.Comparable<E>> org.insa.graphs.algorithm.utils.BinaryHeapFormatter.Context toStringLoop​(BinaryHeap<E> heap,
                                                                                                                                      org.insa.graphs.algorithm.utils.BinaryHeapFormatter.Context ctxt,
                                                                                                                                      int node,
                                                                                                                                      int max_depth)
      • toStringTree

        public static <E extends java.lang.Comparable<E>> java.lang.String toStringTree​(BinaryHeap<E> heap,
                                                                                        int maxDepth)
        Creates a multi-lines string representing a tree view of the given binary heap.
        Parameters:
        heap - The binary heap to display.
        maxDepth - Maximum depth of the tree to display.
        Returns:
        a string containing a tree view of the given binary heap.
      • toStringSorted

        public static <E extends java.lang.Comparable<E>> java.lang.String toStringSorted​(BinaryHeap<E> heap,
                                                                                          int max_elements)
        Creates a multi-lines string representing a sorted view of the given binary heap.
        Parameters:
        heap - The binary heap to display.
        maxElement - Maximum number of elements to display. or -1 to display all the elements.
        Returns:
        a string containing a sorted view the given binary heap.
      • main

        public static void main​(java.lang.String[] args)