Nov 5Explaining TreeMap in Java in Simple EnglishTreeMap in Java, just like the HashMap, is part of the java collection framework. It is a red-black tree-based implementation of the Map interface, NavigableMap, and AbstractMap classes. It stores data in the form of Key and Value pairs where the key is a unique identifier used to associate each…Java3 min readJava3 min read

Published in Javarevisited·Sep 15Count the number of Trailing Zeros in the Factorial of a Given Number.Problem Statement Given a number find the number of trailing zeros that the factorial of that has. Examples : Input: n = 5 Output: 1 Factorial of 5 is 120 which has one trailing 0. Input: n = 20 Output: 4 Factorial of 20 is 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 which has 4 trailing zeroes.Data Structure Algorithm3 min readData Structure Algorithm3 min read

Sep 11How to Merge Two Sorted ArraysProblem You are given two sorted arrays A and B of lengths m and n, the task is to merge the two sorted arrays in such a way that the merged array is also sorted. Example Input A[] = {3, 9, 10, 18, 23} B[] = {5, 12, 15, 20, 21, 25} …Data Structure Algorithm2 min readData Structure Algorithm2 min read

Sep 5Explaining Selection Sort Algorithm in Simple EnglishIn this Blog, we will discuss the Selection Sort Algorithm and its working procedure. Selection sort is an in-place comparison-based sorting algorithm that sorts the array by repeatedly finding and swapping the minimum element with the leftmost element of the array. In-place means that the algorithm does not use extra…Data Structuresalgorithms3 min readData Structuresalgorithms3 min read

Aug 24How to make fireworks in React with Particle JS ReactHave you ever thought about how some developers can create stunning background animations like fireworks, confetti, night sky with blinking stars, etc? At first, I thought it was just a video playing at the back, or come crazy developer with some crazy-ass experience made it, but I was wrong as…Reactjs4 min readReactjs4 min read

Aug 5How to Solve nCr%p?Problem Statement We are given three integers n, r, and p, we have to find the value of nCr%p. Here p is a natural number greater than n and nCr is the Binomial Coefficient. Examples Input: n = 10, r = 2, p = 13 Output: 6 Explanation: 10C2 is 45 and 45…Data Structure Algorithm3 min readData Structure Algorithm3 min read

Jul 5What is HashMap in Java — Explained with examples.HashMap in Java is a part of Java Collections Frameworks since Java 1.2 and provides the basic implementation of the Map interface in Java. It stores data in the form of Key and Value pairs where the key is a unique identifier used to associate each value on the Map…Java3 min readJava3 min read

Jun 9How to Sort an Array of 0s, 1s, and 2s in JavaGiven an array A[] of 0s, 1s, and 2s of size N, the task is to write a function that can sort an array of 0s, 1s, and 2s in ascending order such that 0s are in the beginning followed by all 1s and then 2s at the end, and…Data Structure Algorithm2 min readData Structure Algorithm2 min read

Published in Javarevisited·May 30How to Rotate an Array in Java | TekolioIn this blog, we will learn what exactly array rotation is? And how to rotate an array either in the left or the right direction. Here rotation only means shifting the elements of the array in the desired direction. Example Input : Arr[] = [1, 2, 3, 4, 5] k=2 Output…Dsa5 min readDsa5 min read

May 21How to calculate Leaders in an ArrayLeaders in an array are those elements that are greater than the elements on their right-hand side in the array. This is by default true for the last element as the array end at that element and we can’t compare it with anyone. Difficulty Level — Easy Asked in —…Algorithms2 min readAlgorithms2 min read