# Category Coding in Java

## Find Perfect Number in Java

What is a perfect number? A perfect number is a positive integer that is equal to the sum of its proper divisors excluding itself. These numbers are positive numbers that are less than the number itself. Let’s take an example…

## How to Find Minimum Depth of Binary Tree in Java

Question – Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Logic to solve the minimum depth of the…

## Transpose of Matrix Java

Question – Write a Program to find the transpose of a square matrix of size N*N. Transpose of a matrix is obtained by changing rows to columns and columns to rows. Logic – Interchange transpose matrix, rows and columns Let’s…

## Binary Search Algorithm | Beginner’s Algorithm

Binary search mainly used in searching element from sorted array, we divide the array into two half to reduce the time complexities, we repeat this this untill we get the required element. Prerequisite – The array must be sorted. Time…

## Linear Search Algorithm Java | Beginners Algorithm

In Linear Search Algorithm, we search an element from an array, from one end to another end until we get the required element. It is also called as sequential algorithm. Time Complexity – O(n) Space Complextiy – 1 Algorithm with…

## Selection Sort Algorithm Java | Beginner’s Algorithm

Selection sort algorithm is also one of the easiest algorithm. I have a taken an array as arr[ ] = {5, 3, 2, 1, 6} as an example. The result will be arr[]={1,2,3,5,6}. Logic – Selection Sort Algorithm selects the…