Found 345 Articles for Data Structure Algorithms

Explain Arden’s theorem to convert DFA to Regular Expression

Bhanu Priya
Updated on 11-Jun-2021 12:23:30

5K+ Views

There are two methods for converting a Deterministic Finite Automata (DFA) to Regular expression (RE). These methods are as follows −Arden's Theorem Method.State Elimination Method.Let us understand the Arden's Theorem method in detail.Arden's TheoremLet P and Q be the two regular expressions.If P does not contain null string, then the following equation in R, viz R = Q + RP, Which has a unique solution by R = QP*Here, The finite automata (FA) does not have epsilon moves.It must have only initial state q1.Its states are q1, q2, q3, ....qn. The final state may be some qi where iRead More

What are the fundamental concepts of TOC?

Bhanu Priya
Updated on 11-Jun-2021 13:21:08

8K+ Views

The basic definitions of the fundamental concepts in the Theory of Computation (TOC) along with the relevant examples are explained below −SymbolSymbols simply call it as a character.It is an atomic unit, such as a digit, character, lowercase letter, etc. Sometimes it is also a word. The formal language does not deal with the “meaning” of the symbols.For example, a, b, c, ……………z0, 1, 2, …………..9+, -, *, %, …………special characters.AlphabetThe set of characters is called as the alphabet.An alphabet is a finite, non-empty set of symbols. It is denoted by Σ or E.For example, Σ ={0, 1} set of ... Read More

What is the theory of computation?

Bhanu Priya
Updated on 11-Jun-2021 08:19:30

10K+ Views

Computation is the movement and alteration which occurs during the transition of data or the processing of data based on a set of operations.The theory of computation includes the fundamental mathematical properties of computer hardware, software and their applications. It is a computer science branch which deals with how a problem can be solved efficiently by using an algorithm on a model of computation.The theory of computation field is divided into three concepts, which are as follows −Automated theory and language.Computability theory.Complexity theory.Let us understand these concepts in detail.Automated Theory and languageIt deals with the definition and properties of various ... Read More

Difference Between Bubble Sort and Selection Sort

Kiran Kumar Panigrahi
Updated on 20-Feb-2023 16:21:13

11K+ Views

The task of arranging elements of an array in a particular order is referred to as sorting. The sorting of an array or a list is mainly done to make the searching easier. There are two types of sorting algorithms namely, Bubble Sort and Selection Sort. Bubble sort performs sorting of data by exchanging the elements, while the selection sort performs sorting of data by selecting the elements. Read this article to learn more about bubble sort and selection sort and how these two sorting techniques are different from each other. What is Bubble Sort? Bubble sort is a simple ... Read More

Difference Between Quick Sort and Merge Sort

Kiran Kumar Panigrahi
Updated on 21-Feb-2023 15:16:15

4K+ Views

The task of arranging the elements of an array in a particular order is referred to as sorting. The sorting of an array or a list is mainly done to make the searching easier. There are several types of sorting algorithms, but in this article, we will concentrate on quick sort and merge sort. Both quick sort and merge sort algorithms are based on the divide-and-conquer sorting algorithms, hence they work almost in a similar way. Read this article to learn more about quick sort and merge sort and how these sorting techniques are different from each other. What is ... Read More

Auto-complete feature using Trie

Hafeezul Kareem
Updated on 21-Sep-2020 13:19:12

445 Views

We have a Trie, and when a user enters a character, we have to show the matching string the Trie. This feature we call it as auto-completion. For example, if a Trie contains "xyzzzz, ""xyz, " "xxxyyxzzz" and when the user enter xy, then we have to show them xyzzzz, xyz, etc.., Steps to achieve the result.Search for the string using the standard Trie algorithm.If the string is not present, then return -1.If the string is present and is the end of a word in Trie, then print the string.If the matching string doesn't have any node, then return.Else print ... Read More

Practice Set for Recurrence Relations

sudhir sharma
Updated on 04-Feb-2020 07:41:10

303 Views

Recurrence relations are equations that recursively defines a multidimensional array.Here we will solve so questions based on recurrence relations.Solve the recurrence reation:T(n) = 12T(n/2) + 9n2 + 2. T(n) = 12T(n/2) + 9n2 + 2. Here, a = 12 and b = 2 and f(n) = 9(n)2 + 2 It is of the form f(n) = O(n^c), where c = 2This form its in the master’s theorem condition, So, logb(a) = log2(12) = 3.58 Using case 1 of the masters theorm, T(n) = θ(n3.58).Solve the recurrence reation:T(n) = 5T(n/2 + 23) + 5n2 + 7n - 5/3. T(n) = 5T(n/2 ... Read More

Overflow Handling in Data Structure

Arnab Chakraborty
Updated on 08-Jan-2020 11:32:24

6K+ Views

An overflow occurs at the time of the home bucket for a new pair (key, element) is full.We may tackle overflows bySearch the hash table in some systematic manner for a bucket that is not full.Linear probing (linear open addressing).Quadratic probing.Random probing.Eliminate overflows by allowing each bucket to keep a list of all pairs for which it is the home bucket.Array linear list.Chain.Open addressing is performed to ensure that all elements are stored directly into the hash table, thus it attempts to resolve collisions implementing various methods.Linear Probing is performed to resolve collisions by placing the data into the next ... Read More

Binary Tree ADT in Data Structure

Arnab Chakraborty
Updated on 08-Jan-2020 11:26:15

7K+ Views

Basic conceptA binary tree is defined as a tree in which no node can have more than two children. The highest degree of any node is two. This indicates that the degree of a binary tree is either zero or one or two.In the above fig., the binary tree consists of a root and two sub trees TreeLeft & TreeRight. All nodes to the left of the binary tree are denoted as left subtrees and all nodes to the right of a binary tree are referred to as right subtrees.ImplementationA binary tree has maximum two children; we can assign direct ... Read More

ADT-array Representation in Data Structure

Arnab Chakraborty
Updated on 08-Jan-2020 11:23:37

6K+ Views

Basic conceptADT indicates for Abstract Data Type.Arrays are defined as ADT’s because they are capable of holding contiguous elements in the same order. And they permitaccess for the specific element via index or position.They are abstract because they can be String, int or Personint[] arrA = new int[1]; String[] arrB = new String[1]; Person[] arrC = new Person[3]; // where Person is treated as a defined classAdvantagesFast, random access of items or elements.Very memory efficient, very little memory is needed other than that needed to store the contents.DisadvantagesSlow insertion and deletion of elementsArray size must be known when the array ... Read More

Advertisements