George John has Published 1167 Articles

Check if two given sets are disjoint?

George John

George John

Updated on 17-Jun-2020 09:13:53

599 Views

Two sets are disjoint set when they have no common elements. In other words, if we get the intersection of two sets, then we will get null set.The method is simple, in this algorithm, two sets are given. We assume that both sets are already sorted, items are compared between ... Read More

Linear Regression

George John

George John

Updated on 17-Jun-2020 08:47:12

810 Views

From a given set of data points, the linear regression finds an equation of straight line. The given points will follow the straight line. Using this formula, we can predict what will be the value for some other specific point, which is not present in the set currently.For solving linear ... Read More

Decimal to Binary conversion

George John

George John

Updated on 17-Jun-2020 08:24:51

868 Views

A decimal number can also be converted into its binary form. To convert a decimal number to binary number, we need to divide the number by 2 until it reaches 0 or 1. And in each step, the remainder are stored separately to form the binary equivalent number in reverse ... Read More

Ugly Numbers

George John

George John

Updated on 17-Jun-2020 08:04:29

3K+ Views

Ugly numbers are those number whose prime factors are 2, 3 or 5. From 1 to 15, there are 11 ugly numbers 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15. The numbers 7, 11, 13 are not ugly because they are prime. The number 14 is not ... Read More

Palindrome Partitioning

George John

George John

Updated on 17-Jun-2020 07:22:59

303 Views

In this algorithm, the input is a string, a partitioning of that string is palindrome partitioning when every substring of the partition is a palindrome.In this algorithm, we have to find the minimum cuts are needed to palindrome partitioning the given string.Input and OutputInput: A string. Say “ababbbabbababa” Output: Minimum ... Read More

Maximum Sum Increasing Subsequence

George John

George John

Updated on 17-Jun-2020 07:03:35

404 Views

Maximum Sum Increasing subsequence is a subsequence of a given list of integers, whose sum is maximum and in the subsequence, all elements are sorted in increasing order.Let there is an array to store max sum increasing subsequence, such that L[i] is the max sum increasing subsequence, which is ending ... Read More

Largest Independent Set Problem

George John

George John

Updated on 16-Jun-2020 15:44:45

295 Views

The Independent Set is the subset of all binary tree nodes when there is no edge between any two nodes in that subset. Now from a set of elements, we will find the longest independent set. i.e. If the elements are used to form a binary tree, then all largest subset, ... Read More

Longest Increasing Subsequence

George John

George John

Updated on 16-Jun-2020 15:27:18

1K+ Views

Longest Increasing Subsequence is a subsequence where one item is greater than its previous item. Here we will try to find Longest Increasing Subsequence length, from a set of integers.Input and OutputInput: A set of integers. {0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, ... Read More

Snake and Ladder Problem

George John

George John

Updated on 16-Jun-2020 14:12:48

1K+ Views

We know about the famous game Snake and Ladder. In this game, some rooms are present on the board, with the room number. Some rooms are connected with a ladder or with snakes. When we get a ladder, we can climb up to some rooms to reach near to the ... Read More

Transitive closure of a Graph

George John

George John

Updated on 16-Jun-2020 13:54:00

15K+ Views

Transitive Closure it the reachability matrix to reach from vertex u to vertex v of a graph. One graph is given, we have to find a vertex v which is reachable from another vertex u, for all vertex pairs (u, v).The final matrix is the Boolean type. When there is ... Read More

Advertisements