Depth First search c++

Depth First search c++ Depth First search c++for a graph is similar to Depth First search for a tree. The only change here we do is, unlike trees, graphs may contain cycles, so we this may come to the same node again. To avoid performing a node more than once, we use...

Breadth first search c++

Breadth First Search C++ In graph theory, breadth first search c++ (BFS) is a graph search algorithm that begins at the root node and explores all the neighboring nodes. Then for each of those nearest nodes, it explores their unexplored neighbor nodes, and so on,...

Potential Method in data structure

Potential Method in data structure Potential (Physicist’s) Method As we saw the aggregate method and the banker’s method for dealing with extensible arrays. Now let us look at the physicist’s method. Suppose we can define a potential function Φ (read...

Accounting method in data structure

Accounting method in data structure Accounting (Banker’s) Method Here we explain about accounting method in data structure which is coming under Amortized Analysis .The aggregate method directly seeks a bound on the overall running time of a sequence of...

Amortized Analysis

Amortized Analysis Amortized analysis is a worst-case analysis of a a sequence of operations — to obtain a tighter bound on the overall or average cost per operation in the sequence than is obtained by separately analyzing each operation in the sequence. For an...

C++ disjoint set

C++ disjoint set About disjoint set : C++ Disjoint sets are very useful data structures that are used in many famous Algorithms, and you might consider using them in designing algorithms that include some sort of union behavior. Here we show how to implement a...