Algorithms Articles - Page 22 of 51

Differences between Data paths.

Mahesh Parahar
Updated on 16-May-2020 11:35:42

1K+ Views

Data PathsCPU has two sections, data section and control section. Data section is also called data paths. Registers, ALU and interconnection bus collectively constitutes a data path. Data paths are of three types:Single CycleMultiple CyclePipelineFollowing are some of the important differences between Single Cycle, Multiple Cycle and Pipeline data paths.Sr. No.KeySingle CycleMultiple CyclePipeline1CycleSingle Cycle has one CPI (Clock Cycle Per Instruction).Multiple Cycle has variable CPIs.Pipeline has fixed no. of CPIs.2Instruction divisionIn single cycle, instruction is not divided per CPI.In multiple cycle, an instruction can be divided in arbitrary steps.In pipline, an instruction is divided one step per pipeline stage.3Instruction divisionIn ... Read More

Explain difference between Strong Entity and Weak Entity

Mahesh Parahar
Updated on 16-May-2020 14:36:04

15K+ Views

Strong EntityStrong Entity is independent to any other entity in the schema. A strong entity always have a primary key. In ER diagram, a strong entity is represented by rectangle. Relationship between two strong entities is represented by a diamond. A set of strong entities is known as strong entity set.Weak EntityWeak entity is dependent on strong entity and cannot exists without a corresponding strong. It has a foreign key which relates it to a strong entity. A weak entity is represented by double rectangle. Relationship between a strong entity and a weak entity is represented by double diamond. The ... Read More

Practice Set for Recurrence Relations

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

471 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

Huffman Trees in Data Structure

Arnab Chakraborty
Updated on 16-Jan-2020 12:07:48

15K+ Views

DefinitionHuffman coding provides codes to characters such that the length of the code depends on the relative frequency or weight of the corresponding character. Huffman codes are of variable-length, and without any prefix (that means no code is a prefix of any other). Any prefix-free binary code can be displayed or visualized as a binary tree with the encoded characters stored at the leaves.Huffman tree or Huffman coding tree defines as a full binary tree in which each leaf of the tree corresponds to a letter in the given alphabet.The Huffman tree is treated as the binary tree associated with ... Read More

Dictionary Operations in Data Structure

Arnab Chakraborty
Updated on 16-Jan-2020 12:05:44

12K+ Views

A dictionary is defined as a general-purpose data structure for storing a group of objects. A dictionary is associated with a set of keys and each key has a single associated value. When presented with a key, the dictionary will simply return the associated value.For example, the results of a classroom test could be represented as a dictionary with student's names as keys and their scores as the values:results = {'Anik' : 75, 'Aftab' :80, 'James' : 85, 'Manisha': 77, 'Suhana' :87, 'Margaret': 82}Main operations of dictionariesDictionaries typically support so many operations −retrieve a value (based on language, attempting to ... Read More

Bayes’ Rule in Data Structure

Arnab Chakraborty
Updated on 16-Jan-2020 12:05:07

262 Views

A way to update our beliefs depended on the arrival of new, relevant pieces of evidence are provided by Bayes rule. For example, if we were trying to provide the probability that a given person has cancer, we would initially just conclude it is whatever percent of the population has cancer. However, given extra evidence such as the fact that the person is a smoker, we can update our probability, since the probability of having cancer is greater given that the person is a smoker. This allows us to utilize prior knowledge to improve our probability estimations.The rule is explained ... Read More

Boole’s Inequality in Data Structure

Arnab Chakraborty
Updated on 16-Jan-2020 12:04:28

418 Views

In probability theory, according to Boole's inequality, also denoted as the union bound, for any finite or countable set of events, the probability that at least one of the events happens is no higher than the sum of the probabilities of the individual events.In mathematics, the probability theory is denoted as an important branch that studies about the probabilities of the random event. The probability is denoted as the measurement of chances of happening an event which is an outcome of an experiment.For Example − tossing a coin is denoted as an experiment and getting head or tail is denoted ... Read More

Overflow Handling in Data Structure

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

9K+ 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

11K+ 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

8K+ 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