Samual Sam has Published 2492 Articles

Fastest Way to multiply two Numbers

Samual Sam

Samual Sam

Updated on 17-Jun-2020 09:35:14

518 Views

Two numbers are given as a binary string, our task is to find the result of multiplication for those numbers in a faster and efficient way.Using the Divide and Conquer strategy, we can solve the problem, in a very efficient manner. We will split the numbers into two halves.let Xleft ... Read More

Graham Scan Algorithm

Samual Sam

Samual Sam

Updated on 17-Jun-2020 09:26:16

5K+ Views

The convex hull is the minimum closed area which can cover all given data points.Graham’s Scan algorithm will find the corner points of the convex hull. In this algorithm, at first, the lowest point is chosen. That point is the starting point of the convex hull. Remaining n-1 vertices are ... Read More

DFA based division

Samual Sam

Samual Sam

Updated on 17-Jun-2020 09:23:06

223 Views

Deterministic Finite Automaton(DFA) is used to check whether a number is divisible by another number k or not. If it is not divisible, then this algorithm will also find the remainder.For the DFA based division, at first, we have to find the transition table of the DFA, using that table, ... Read More

Trapezoidal Rule for definite integral

Samual Sam

Samual Sam

Updated on 17-Jun-2020 08:48:56

1K+ Views

Definite integrals can be solved using this trapezoidal rule. To integrate a function f(x) between the range a to b is basically finding the area below the curve from point x = a to x = b. To find that area, we can divide the area into n trapezoids, and the ... Read More

Runge-Kutta 4th order rule for differential equation

Samual Sam

Samual Sam

Updated on 17-Jun-2020 08:37:44

2K+ Views

Runge Kutta method is used for solving ordinary differential equations (ODE). It uses dy/dx function for x and y, and also need the initial value of y, i.e. y(0). It finds the approximate value of y for given x. For solving ODE, we have to follow these formulas:Here h is ... Read More

Find LCM of two numbers

Samual Sam

Samual Sam

Updated on 17-Jun-2020 08:19:33

596 Views

In mathematics Least Common Multiple (LCM) is the smallest possible integer, that is divisible by both numbers.LCM can be calculated by many methods, like factorization, etc. but in this algorithm, we have multiplied the bigger number with 1, 2, 3…. n until we find a number which is divisible by ... Read More

Rod Cutting

Samual Sam

Samual Sam

Updated on 17-Jun-2020 08:11:06

5K+ Views

A rod is given of length n. Another table is also provided, which contains different size and price for each size. Determine the maximum price by cutting the rod and selling them in the market.To get the best price by making a cut at different positions and comparing the prices ... Read More

Convert Infix to Prefix Expression

Samual Sam

Samual Sam

Updated on 17-Jun-2020 07:51:44

5K+ Views

To solve expressions by the computer, we can either convert it in postfix form or to the prefix form. Here we will see how infix expressions are converted to prefix form.At first infix expression is reversed. Note that for reversing the opening and closing parenthesis will also be reversed.for an ... Read More

Break Number Into 3 parts to find max sum

Samual Sam

Samual Sam

Updated on 17-Jun-2020 07:33:43

422 Views

A number is given. Our task is to break the number three times by n/2, n/3, and n/4 and find maximum sum we can make by dividing the number into three parts.For an example, 50 can be divided into {25, 16, 12}, now break each of the set {25, 16, ... Read More

Wildcard Pattern Matching

Samual Sam

Samual Sam

Updated on 17-Jun-2020 07:27:53

1K+ Views

For this problem, one main string and another wildcard patterns are given. In this algorithm, it will check whether the wildcard pattern is matching with the main text or not.The wildcard pattern may contain letters or ‘*’ or ‘?’ Symbols. The ‘?’ Is used to match a single character and ... Read More

Advertisements