Types of Inheritance in C++ The process of inheriting properties of objects of one class by objects of another class. The class whose properties are inherited by another class is called Base or Parent or Super class and the class which inherits properties of another class is called Derived or Child or Sub class. C++ supports six types […]
How To Swap Values In C++
C++ Swap Function Swap function is used to interchange two values in variables with each other. For example variable x contains 10 and y contains 20, after swap, x contains 20 and y contains 10. C++ has a inbuild swap function i.e, swap(x,y). Without using this inbuild function we can […]
Dijkstra’s Algorithm In C++ – Finding Shortest Path – With Sample Code
Dijkstra Algorithm – Finding Shortest Path Dijkstra’s Algorithm is designed to determine the shortest routes between the source node and every other node in the network. Algorithm:- Start with a weighted graph. Initialize source node with a distance of 0 & all other nodes with infinite distance. For each neighbor […]