C Program to find a minimum spanning tree using Prim’s algorithm

Prim’s algorithm is a greedy algorithm that finds a Minimum Spanning Tree (MST) for a weighted, connected, undirected graph. A spanning tree connects all the vertices of a graph with no cycles; the minimum spanning tree is the one whose total edge weight is the smallest possible. Prim’s builds this tree one vertex at a …

Binary Search Tree in C – Insert, Search, Delete, and Traversals

A binary search tree (BST) in C is a binary tree where every node satisfies one invariant: all values in the left subtree are less than the node, and all values in the right subtree are greater. This ordering means search, insert, and delete all run in O(h) time — where h is the tree …