Category : tree

this is the question of geeks for geeks https://practice.geeksforgeeks.org/problems/minimum-spanning-tree/1/?track=mdcq-algorithms&batchId=184 and i have learnt the conctp from https://www.geeksforgeeks.org/kruskals-minimum-spanning-tree-algorithm-greedy-algo-2/ i have written a code for this min spanning trree using kruksals algo…..but this sol is not accpted by geeks for geeks this is the code which ihave written public: vector<int> parent, rank; void make_set(int v) { parent[v] ..

Read more

I am making a Quadtree in C++. I need to find the leaf nodes of the tree. To do this I have this function that needs to return a vector of the leaf nodes. For now everything else seems to work, but this function doesn’t and I don’t understand why. vector<QuadTree*> find_leaves(QuadTree* quad, vector<QuadTree*>& list_of_leaves) ..

Read more