Found 510 Articles for Algorithms

Difference Between Aggregation and Association

AmitDiwan
Updated on 02-Mar-2021 05:19:14

1K+ Views

In this post, we will understand the differences between aggregation and association.AssociationIt can be understood as an organization of people that have a common purpose. It also indicates that they consist of a formal structure. It represents a binary relationship between the two objects that describe some kind of activity.It is a relationship between multiple objects.An example would be how consuming healthy food is related not just to a healthy weight, but to good skin, good hair, strength and being active.Association is a relationship between two classes where one class uses the other class.It is not flexible in natureThis indicates ... Read More

Difference Between Full Virtualization and Paravirtualization

AmitDiwan
Updated on 02-Mar-2021 05:17:13

2K+ Views

In this post, we will understand the differences between full virtualization and paravirtualizationFull VirtualizationThis process was introduced by IBM in the year 1966. It is considered to be the first software solution for server virtualization. It uses binary translation and a direct approach method.In this, the guest OS is fully isolated using the virtual machine from the virtualization layer and hardware.Examples of full virtualization include Microsoft and Parallels systems.The virtual machine permits the execution of the instructions in addition to running the unmodified OS in a completely isolated method.It is considered to be less secure in comparison to paravirtualization.It uses ... Read More

Difference Between Flood-fill and Boundary-fill Algorithm

AmitDiwan
Updated on 02-Mar-2021 05:11:06

2K+ Views

In this post, we will understand the differences between flood fill algorithm and boundary fill algorithm. They are area-filling algorithms, and they can be differentiated based on whether a random pixel has the region's original colour or not.Flood-fill algorithmIt is also known as seed fill algorithm.It calculates the area that is connected to a given node with respect to a multi-dimensional array.It works by filling up or recolouring a specific area that contains different colours in the inside part, and hence, the boundary of the image.It is represented by a picture that has a neighbourhood which has borders and has ... Read More

Difference Between Algorithm and Pseudocode

Kiran Kumar Panigrahi
Updated on 22-Oct-2023 13:27:01

28K+ Views

Algorithm and Pseudocode are the two related terms in computer programming. The basic difference between algorithm and pseudocode is that an algorithm is a step-by-step procedure developed to solve a problem, while a pseudocode is a technique of developing an algorithm. In this article, we will discuss the other important differences between an algorithm and a pseudocode. Let's start with some basic concepts of algorithm and pseudocode. What is an Algorithm? A sequence of steps to solve a given problem is called as algorithm. Thus, an algorithm is a step-by-step procedure developed for solving a given problem. An ... Read More

Difference Between Greedy Method and Dynamic Programming

AmitDiwan
Updated on 02-Mar-2021 05:04:41

452 Views

In this post, we will understand the differences between the greedy algorithm and dynamic programming methods.Greedy algorithmIt is an algorithmic paradigm that builds up on a solution in parts, step by step. The next step is chosen such that it gives the most obvious and immediate benefit.Problems that involve choosing local optimal values will help in choosing the global optimal values/solution to the problem. Such ate the problems associated with greedy algorithm.There is no surety that a greedy algorithm would lead to an optimal solution.An optimal choice is made at every stage of the problem, i.e the local optimal solution.It ... Read More

Difference Between Prim’s and Kruskal’s Algorithm

AmitDiwan
Updated on 02-Mar-2021 05:02:09

666 Views

In this post, we will understand the differences between Prim's and Kruskal's algorithms.Kruskal's algorithm for Mininum Spanning Tree (MST)When a connected and undirected graph is given, a spanning tree of such a graph is the subgraph which is a tree that connects all of the vertices.A single graph can have multiple spanning trees.A minimum spanning tree (MST) (also known as minimum weight spanning tree) for a weighted, connected and undirected graph is a spanning tree that weighs less than or equal to the weight of every other spanning tree.The weight of a spanning tree is determined by adding the weights ... Read More

Yen's k-Shortest Path Algorithm in Data Structure

Dev Prakash Sharma
Updated on 23-Feb-2021 06:35:29

1K+ Views

Instead of giving a single shortest path, Yen’s k-shortest path algorithm gives k shortest paths so that we can get the second shortest path and the third shortest path and so on.Let us consider a scenario that we have to travel from place A to place B and there are multiple routes available between place A and place B, but we have to find the shortest path and neglect all the paths that are less considered in terms of its time complexity in order to reach the destination.Let us understand with an example-Consider the given example as the bridge which ... Read More

Algorithm to construct an Expression Tree in Data Structure

Dev Prakash Sharma
Updated on 23-Feb-2021 18:11:51

7K+ Views

Expression treesExpression trees are those in which the leaf nodes have the values to be operated, and internal nodes contain the operator on which the leaf node will be performed.Example4 + ((7 + 9) * 2) will have an expression tree as followsAlgorithm to Construct an Expression TreeLet T be the expression tree.If T is not NULL:   If T->data is an operand:      return T.data   A = solve(T.left)   B = solve(T.right)   --> Calculate operator for 'T.data' on A and B, and call recursively,       return calculate(A, B, T.data)How to construct an expression tree?To construct an Expression Tree for ... Read More

Shortest Path algorithm in Computer Network

Moumita
Updated on 06-Sep-2023 21:32:55

45K+ Views

In computer networks, the shortest path algorithms aim to find the optimal paths between the network nodes so that routing cost is minimized. They are direct applications of the shortest path algorithms proposed in graph theory.ExplanationConsider that a network comprises of N vertices (nodes or network devices) that are connected by M edges (transmission lines). Each edge is associated with a weight, representing the physical distance or the transmission delay of the transmission line. The target of shortest path algorithms is to find a route between any pair of vertices along the edges, so the sum of weights of edges ... Read More

Dijkstra’s algorithm to compute the shortest path through a graph

Moumita
Updated on 22-Feb-2021 11:38:19

19K+ Views

DefinitionThe Dijkstra’s algorithm finds the shortest path from a particular node, called the source node to every other node in a connected graph. It produces a shortest path tree with the source node as the root. It is profoundly used in computer networks to generate optimal routes with the aim of minimizing routing costs.Dijkstra’s AlgorithmInput − A graph representing the network; and a source node, sOutput − A shortest path tree, spt[], with s as the root node.Initializations −An array of distances dist[] of size |V| (number of nodes), where dist[s] = 0 and dist[u] = ∞ (infinite), where u ... Read More

Advertisements