Shubham Vora has Published 962 Articles

Boundary Level order traversal of a Binary Tree

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:49:41

92 Views

In this problem, we will traverse each boundary of the given binary tree in the given order. We will use the recursive approach to traverse each boundary of the binary tree one by one. However, we will also learn the iterative approach using a stack to traverse the binary tree's ... Read More

Minimum Jumps from Either End to Reach Largest and Smallest Character in given String

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:43:26

56 Views

In this problem, we require to find the minimum jumps required to make to reach the largest and smallest character in the given string. We can move to the next or previous character in one jump. We can solve the problem by finding the position of the lexicographically largest and ... Read More

Length of Smallest Substring to be Replaced to make Frequency of each Character as N/3

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:38:41

74 Views

In this problem, we need to find the smallest substring so that we can replace its character and make the frequency of each character equal to the N/3 in the given string. We can use the sliding window technique to solve the problem. We can find the minimum window size, ... Read More

Javascript Program to Minimize Characters to be Changed to make the Left and Right Rotation of a String Same

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:31:37

59 Views

In this problem, we require to determine the minimal cost to make the string’s left and right rotation same. Here is the observation which we will use to solve the problem. All characters should be equal for strings with odd lengths to make the left and right rotations ... Read More

Java Program to Minimize Characters to be changed to make the Left and Right Rotation of a String Same

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:24:18

70 Views

In this problem, we need to change the minimum characters in the given string to make its left and right rotations the same. In the string, we can observe that we can only make the left and right rotations of the string same if the string has an odd length ... Read More

Java Program to Find Maximum number of 0s placed consecutively at the start and end in any rotation of a Binary String

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:22:27

67 Views

In this problem, we will write Java code to find the maximum sum of consecutive zeros at the start and end of any string rotation. First, we will use a naĂŻve approach to solve the problem, which generates all rotations of the binary string and counts the starting and ending ... Read More

Java Program to Implement Unrolled Linked List

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 18:10:04

91 Views

In this problem, we will learn to implement the unrolled linked list. The unrolled linked list is a specialized version of the linked list. The normal linked list contains a single element in a single node, but the unrolled linked list contains a group of elements in each node. ... Read More

Java Program to Implement the Vizing's Theorem

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 18:07:17

42 Views

In this problem, we need to implement Vizing's Theorem. Vizing's Theorem is used with graphs. Theorem statement - For any undirected graph G, the value of the Chromatic index is equal to the d or d + 1, where d is the maximum degree of the graph. ... Read More

Java Program to Implement the Schonhage-Strassen Algorithm for Multiplication of Two Numbers

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 18:04:22

117 Views

The Schonhage-Strassen algorithm is useful when we need to multiply large decimal numbers. As Java supports the 1018 size of integers, and if we need to multiply the digits of more than 1018, we need to use the Schonhage-Strassen algorithm, as it is one of the fastest multiplication algorithms. ... Read More

Java Program to Implement the Monoalphabetic Cypher

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 18:01:42

482 Views

In this problem, we need to convert the text to cipher text using the Monoalphabetic Cipher technique. All alphabetical characters are pre-mapped to their cipher character in the Monoalphabetic Cipher algorithm. So, we need to substitute all plain text characters with their mapped characters. Here is ... Read More

Advertisements