Nizamuddin Siddiqui has Published 2307 Articles

How to implement minimum step to one using bottom-up approach using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:22:48

148 Views

MinimumStepstoOneBottomdownApproachtakes integer n as input. Parameter n contains the total number of elements. Initial condition checks whether n is equal to 1. If n is equal to 1 then return 0. Initialize op1, op2 and op3 to max value. If n mod 3 is equal to 0 then call MinimumStepstoOneBottomdownApproach ... Read More

How to implement minimum step to one using topDown approach using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:19:00

103 Views

MinimumStepstoOneTopdownApproach takes integer n and an integer array as input. Parameter n contains the total number of elements. Initial condition checks whether n is equal to 1. If n is equal to 1 then return 0. Initialize op1, op2 and op3 to max value . If n mod 3 is ... Read More

How to implement Fibonacci using bottom-up approach using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:16:26

385 Views

The Fibonacci sequence is a set of numbers that starts with a one or a zero, followed by a one, and proceeds based on the rule that each number (called a Fibonacci number) is equal to the sum of the preceding two numbers. The bottom-up approach first focuses on solving ... Read More

How to implement Fibonacci using topDown approach using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:13:23

551 Views

The Fibonacci sequence is a set of numbers that starts with a one or a zero, followed by a one, and proceeds based on the rule that each number (called a Fibonacci number) is equal to the sum of the preceding two numbers. The top-down approach focuses on breaking down ... Read More

How to find the length of the longest continuous increasing subsequence from an array of numbers using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:12:06

669 Views

LongestIncreaingSubsequence returns integer of the continuous subsequence from the array. The method has a for loop, which iterates and keeps the track of the numbers. the final result will have the Max calculated. Time complexity is O(N) because every element is visited once and the space complexity is O(1) because ... Read More

How to find the length of the longest substring from the given string without repeating the characters using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:08:45

986 Views

From the given string input, use the sliding window technique by having 2 pointers i and j . both i and j will point to the same character in the string. Traverse through the string and add it to the list. If the repeated character is found then remove it ... Read More

How to check whether the given strings are isomorphic using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:06:07

690 Views

Two strings, X and Y, are called isomorphic if all occurrences of each character in X can be replaced with another character to get Y and vice-versa. For example, consider strings ACAB and XCXY. All occurrences of a character must be replaced with another character while preserving the order of ... Read More

How to move all the zeros to the end of the array from the given array of integer numbers using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 08:00:57

532 Views

Create a method MoveZeros, traverse through the array and count the number of Zeros in the array. Based on the count size make all the final cells to zero. Return without processing if the array length is null or empty. The final result will be in nums Array. Time complexity ... Read More

How to generate pascals triangle for the given number using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 07:57:48

91 Views

Pascal’s Triangle is a number pattern in the shape of a triangle. Pascal’s Triangle has many applications in mathematics and statistics, including its ability to help you calculate combinations.Each number in the triangle is the sum of the two numbers above it. For example, row 4 − it’s the sum ... Read More

How to find the quadruplet that is close to target using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 17-Aug-2021 07:51:43

78 Views

Two Pointers pattern and is similar to quadruplet Sum to Zero. We can follow a similar approach to iterate through the array, taking one number at a time. At every step, we will save the difference between the quadruplet and the target number, and at each step we will compare ... Read More

Advertisements