C++ program for Queue using Linked list
Concept: Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and…
q
Concept: Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and…
Concept: A queue data structure can be implemented using one dimensional array. But, queue implemented using array can store only fixed number of data values. The implementation of queue data structure…
Concept:Heap is a special case of balanced binary tree data structure where the root-node key is compared with its children and arranged accordingly. If A has child node B then…
N Queen’s problem: The n-queens problem consists of placing n queens on an n x n checker board in such a way that they do not threaten each other, according to…
Floyd’s Algorithm:Floyd‟s algorithm is applicable to both directed and undirected graphs provided that they do not contain a cycle. It is convenient to record the lengths of shortest path in…
Prim’s Algorithm:Prim‟s algorithm finds the minimum spanning tree for a weighted connected graph G=(V,E) to get an acyclic subgraph with |V|-1 edges for which the sum of edge weights is…
Traveling Salesperson problem:Given n cities, a salesperson starts at a specified city (source), visit all n-1 cities only once and return tio the the city from where he has started.…
Sum of SubsetsSubset-Sum Problem is to find a subset of a given set S= {s1, s2… sn} of n positive integers whose sum is equal to a given positive integer…
Depth First Search:Depth-first search starts visiting vertices of a graph at an arbitrary vertex by marking it as having been visited. On each iteration, the algorithm proceeds to an unvisited…
Breadth First Search:BFS explores graph moving across to all the neighbors of last visited vertex traversals i.e., it proceeds in a concentric manner by visiting all the vertices that are…