Sharon Christine has Published 433 Articles

Sudoku Solving algorithms

Sharon Christine

Sharon Christine

Updated on 16-Jun-2020 07:04:00

3K+ Views

In this section, we will try to solve the famous number maze problem called Sudoku. Sudoku is a 9 x 9 number grid, and the whole grid are also divided into 3 x 3 boxes There are some rules to solve the Sudoku.We have to use digits 1 to 9 ... Read More

Why multiple inheritance is not supported by Java?

Sharon Christine

Sharon Christine

Updated on 16-Jun-2020 06:27:30

6K+ Views

Multiple inheritances lead to ambiguity.For example, if there is a class named Sub and there are two classes Super1 and Super2 and if both contains a method named sample(). And if the class sub inherits both classes Super1 and Super2 then there will be two copies of the sampling method one ... Read More

Suffix Array

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 19:15:53

884 Views

From a given string, we can get all possible suffixes. After sorting the suffixes in lexicographical order, we can get the suffix array. Suffix arrays can also be formed using suffix trees. By using the DFS traversal of suffix trees, we can get suffix arrays. Suffix arrays are helpful to ... Read More

Naive Pattern Searching

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 18:34:58

6K+ Views

Naïve pattern searching is the simplest method among other pattern searching algorithms. It checks for all character of the main string to the pattern. This algorithm is helpful for smaller texts. It does not need any pre-processing phases. We can find substring by checking once for the string. It also ... Read More

Bad Character Heuristic

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 17:45:08

1K+ Views

The bad character heuristic method is one of the approaches of Boyer Moore Algorithm. Another approach is Good Suffix Heuristic. In this method we will try to find a bad character, that means a character of the main string, which is not matching with the pattern. When the mismatch has ... Read More

Efficient Construction of Finite Automata

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 17:31:15

1K+ Views

By constructing Finite Automata, we can simply perform the pattern searching in texts. At first, we have to fill a 2D array to make the transition table of the finite automata. Once the table is created, the searching procedure is simple. By starting from the first state of the automaton, ... Read More

Prim’s MST for Adjacency List Representation

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 17:13:06

2K+ Views

It is similar to the previous algorithm. Here the only difference is, the Graph G(V, E) is represented by an adjacency list.Time complexity adjacency list representation is O(E log V).Input and OutputInput: The cost matrix: Output: Edge: A--B And Cost: 1 Edge: B--E And Cost: 2 Edge: A--C And ... Read More

Aho-Corasick Algorithm

Sharon Christine

Sharon Christine

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

1K+ Views

This algorithm is helpful to find all occurrences of all given set of keywords. It is a kind of Dictionary-matching algorithm. It uses a tree structure using all keywords. After making the tree, it tries to convert the tree as an automaton to make the searching in linear time. There ... Read More

Efficient Huffman Coding for Sorted Input

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 16:08:20

455 Views

In the previous Huffman code problem, the frequency was not sorted. If the frequency list is given in sorted order, the task of assigning code is being more efficient.In this problem, we will use two empty queues. Then create a leaf node for each unique character and insert it into ... Read More

Minimum Number of Platforms Problem

Sharon Christine

Sharon Christine

Updated on 15-Jun-2020 15:48:57

505 Views

A list of arrival and departure time is given. Now the problem is to find the minimum number of platforms are required for the railway as no train waits.By sorting all timings in sorted order, we can find the solution easily, it will be easy to track when the train has ... Read More

Advertisements