Shubham Vora has Published 957 Articles

Java Program to Implement the Vizing's Theorem

Shubham Vora

Shubham Vora

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

137 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

257 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 String Search Algorithm for Short Text Sizes

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:56:59

164 Views

In this problem, we need to find the index of the pattern in the string. Implementing an efficient text search is very important to allow users to search large text databases easily. For example, you are writing a blog in Microsoft Word or code in VSCode, containing 1 lakh+ word. ... Read More

Sum of all prefixes of given numeric string

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:48:33

194 Views

In this problem, we need to find the sum of all prefixes of the given string. The best solution approach is that traverse through each prefix of the string and add them to get the answer. Problem statement - We have given a string named num_Str containing N ... Read More

Minimize the cost to convert given string to either type XYXY… or XXYY…

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:46:19

134 Views

In this problem, we need to convert the given binary string to abababab or aabbaabb format and find the minimum cost for that. Also, we have given the cost to flip any character in the operations array. Problem statement - We have given a bin_str binary string and operations ... Read More

Maximum string length after choosing strings from given Array with given conditions

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:32:53

398 Views

In this problem, we need to find the maximum length of the resultant string by appending the array strings to it such that if we choose a string of length x, we can choose the next x/2 strings. We can solve the programming using the recursive function, memoization, and ... Read More

Maximum adjacent index difference for a subsequence T present in given string S

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:29:28

170 Views

In this problem, we need to find the maximum difference between the indices of the subsequence present in the given string. To solve the problem, we need to find the indices of the subsequence in the actual and reverse order. After that, we need to take the difference ... Read More

Maximize characters to be removed from string with given condition

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:25:16

157 Views

In this problem, we need to remove the maximum characters from the string if the adjacent character is the previous character. We can find the occurrence of each character and check whether any of its adjacent characters is a previous character, we can remove the particular character. Problem ... Read More

Find the Suffix Array of given String with no repeating character

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:22:51

142 Views

In this problem, we will find the suffix array of the given string. We can sort all the string's suffixes using their first character, as the input string contains different characters. Problem statement - We have given a string containing the different alphabetical characters, and we need to find ... Read More

Find frequency of each digit 0-9 by concatenating ASCII values of given string

Shubham Vora

Shubham Vora

Updated on 24-Aug-2023 17:21:14

158 Views

In this problem, we need to count digits frequencies after merging the ASCII values of all characters. The approach to solving the problem is to create a string containing each character's ASCII values and count the frequency of the digits in the string. Problem statement - We have ... Read More

Advertisements