Found 510 Articles for Algorithms

Dictionary Operations in Data Structure

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

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

176 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

256 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

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

Time and Space Complexity in Data Structure

Arnab Chakraborty
Updated on 01-Nov-2023 01:51:07

44K+ Views

Algorithm AnalysisAnalysis of efficiency of an algorithm can be performed at two different stages, before implementation and after implementation, asA priori analysis − This is defined as theoretical analysis of an algorithm. Efficiency of algorithm is measured by assuming that all other factors e.g. speed of processor, are constant and have no effect on implementation.A posterior analysis − This is defined as empirical analysis of an algorithm. The chosen algorithm is implemented using programming language. Next the chosen algorithm is executed on target computer machine. In this analysis, actual statistics like running time and space needed are collected.Algorithm analysis is ... Read More

Algorithm Specification-Introduction in Data Structure

Arnab Chakraborty
Updated on 28-Jun-2024 13:04:32

22K+ Views

An algorithm is defined as a finite set of instructions that, if followed, performs a particular task. All algorithms must satisfy the following criteria - Input An algorithm has zero or more inputs, taken or collected from a specified set of objects. Output An algorithm has one or more outputs having a specific relation to the inputs. Definiteness Each step must be clearly defined; Each instruction must be clear and unambiguous. Finiteness The algorithm must always finish or terminate after a finite number of steps. Effectiveness All operations to be accomplished must be sufficiently basic that they can be ... Read More

Data objects and Structures

Arnab Chakraborty
Updated on 08-Jan-2020 11:08:19

2K+ Views

Basic conceptData structures are defined as special classes implemented to hold data only, i.e. Pure models, e.g. Car, Kid, Animal, Event, Employee, Company, Customer ...etc. Those data are generally declared or considered as instance variables in other classes beginnings.The methods of this class should not perform any real significant work, otherwise the data structure class is not a data structure anymore!So mainly, the methods are getters and setters (i.e. accessors and mutators), generally because the instance variables are treated as private. There is alternative opinion: that Data structure variables should be public, and can be accessed directly from the instance ... Read More

Kinetic Data Structures

Arnab Chakraborty
Updated on 08-Jan-2020 11:02:46

487 Views

Basic conceptA kinetic data structure is defined as a data structure implemented to track an attribute of a geometric system that is moving continuously. For example, a kinetic convex hull data structure tracks the convex hull of a group of n moving points.The development of kinetic data structures was inspired by computational geometry problems involving physical objects in continuous motion, for example collision or visibility detection in robotics, animation or computer graphics.OverviewKinetic data structures are implemented on systems where there is a set of values that are changing as a function of time, in a called fashion. So the system ... Read More

Advertisements