Found 507 Articles for Algorithms

Counting Cache Misses in Data Structure

Arnab Chakraborty
Updated on 10-Aug-2020 08:01:20

308 Views

In algorithm analysis we count the operations and steps. This is basically justified when computer takes more time to perform an operation than they took to fetch the data needed for that operation. Nowadays the cost of performing an operation is significantly lower than the cost of fetching data from memory.The run time of many algorithms is dominated by the number of memory references (number of cache misses) rather than by the number of operations. So, when we will try to desing some algorithms, we have to focus on reducing not only the number of operations but also the number ... Read More

Operation Counts Method in Algorithm

Arnab Chakraborty
Updated on 10-Aug-2020 07:57:52

4K+ Views

There are different methods to estimate the cost of some algorithm. One of them by using the operation count. We can estimate the time complexity of an algorithm by choosing one of different operations. These are like add, subtract etc. We have to check how many of these operations are done. The success of this method depends on our ability to identify the operations that contribute most of the time complexity.Suppose we have an array, of size n [0 to n - 1]. Our algorithm will find the index of largest element. We can estimate the cost by counting number ... Read More

Back-off Algorithm for CSMA/CD

sudhir sharma
Updated on 06-Aug-2020 07:58:20

6K+ Views

Back Off Algorithm is an algorithm used for collision resolution. It works as, When this collision occurs, both the devices wait for a random amount of time before retransmitting the signal again, they keep on trying until the data is transferred successfully. This is called back off, since the nodes ‘back-off’ for a certain amount of time, before they try to re-access it again. This random amount of time is directly proportional to the number of attempts it has made to transmit the signal.AlgorithmBelow is a simple flowchart to explain the Back Off Algorithm in brief.As can be seen, that ... Read More

Difference between Block Cipher and Stream Cipher

Kiran Kumar Panigrahi
Updated on 27-Jul-2022 10:17:01

13K+ Views

Both Block cipher and Stream cipher belong to the family of symmetric key ciphers which are the basically encryption methods primarily used for converting the plaintext into ciphertext directly.Go through this article to find out more about the features of block ciphers and stream ciphers and how they are different from each other.What is Block Cipher?A block cipher is a symmetric cryptographic technique that uses a shared, secret key to encrypt a fixed-size data block. During encryption, plaintext is used, and ciphertext is the resultant encrypted text. The plaintext and ciphertext are both encrypted using the same key.A block cipher ... Read More

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

425 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

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

239 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

Advertisements