static void Main(string[] args)
        {
            int[] arr = { 10, 9, 8, 7, 4, 70, 60, 50 };
            int   k   = 4;

            BinaryHeapUtility.Sort(arr, k);

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            string str = "ABCDBAGHCHFAC";
            int    k   = 3;

            BinaryHeapUtility.FirstKNonRepeatingCharacters(str, k);

            Console.ReadKey();
        }
Example #3
0
        static void Main(string[] args)
        {
            int[] arr = { 90, 15, 10, 7, 12, 2, 7, 3 };

            bool res = BinaryHeapUtility.CheckBinaryHeap(arr, 0, arr.Length);//MaxHeap

            if (res == true)
            {
                Console.WriteLine("It is a binary heap i.e. Max Heap");
            }
            else
            {
                Console.WriteLine("It is not a binary heap");
            }

            Console.ReadKey();
        }