This document contains a Java program to find the union and intersection of two arrays using hashing techniques. We will use a HashSet […]
Author: Aditya Bhuyan
Finding Duplicate Subtrees in a Binary Tree in Java
This document presents a Java program that identifies duplicate subtrees in a binary tree using hashing. The approach leverages a serialization technique combined […]
Count Distinct Elements in Every Window of Size k in Java
This Java program counts the number of distinct elements in every sliding window of size k in a given array. It utilizes a […]
Ternary Search Algorithm in C
Introduction The ternary search algorithm is a divide-and-conquer algorithm used for finding an element in a sorted array. It works by dividing the […]
Exponential Search Algorithm in C
Introduction Exponential search is an algorithm for searching a sorted array. It works by first finding a range where the target element may […]
Interpolation Search Algorithm in C
The Interpolation Search is an improved variant of binary search. It works on the principle of estimating the position of the target value […]
Binary Search Algorithm in C
Program Overview The binary search algorithm is an efficient method for finding a target value in a sorted array. It works by repeatedly […]
Heap Sort Algorithm in C
Overview Heap sort is a comparison-based sorting algorithm that uses a binary heap data structure. It divides the input into a sorted and […]
Quick Sort Algorithm in C
Program Explanation Quick Sort is a highly efficient sorting algorithm that uses the divide-and-conquer principle. It works by selecting a ‘pivot’ element from […]
Merge Sort Algorithm in C
Introduction Merge sort is a divide-and-conquer algorithm that sorts an array by recursively splitting it into two halves, sorting each half, and then […]
