What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-12 02:30:03
prims c++
#include <iostream> #include <vector> #include <queue> #include <functional> #include <utility> using namespace std; const int MAX = 1e4 + 5; typedef pair<long long, int> PII; bool marked[MAX]; vector <PII> adj[M... Add solution -
C++ 2021-11-13 07:45:32
priority queue descending order c++
// using GCC 10.2 (C++2a) compiler #include <functional> #include <queue> #include <vector> #include <iostream> template<typename T> void print_queue(T& q) { while(!q.empty()) { std::cout << q.top() &l... Add solution -
Other 2021-11-13 03:14:24
Difference between Priority Queue and Heap
This is frequently used in Competitive Programming. We first multiply all elements with (-1). Then we create a max heap (max heap is the default for priority queue). When we access the data and want to print it we simply multiply those elements with (-1)... Add solution -
Python 2021-11-08 16:38:07
convert c++ code to python online
// Program to print path from root node to destination node // for N*N -1 puzzle algorithm using Branch and Bound // The solution assumes that instance of puzzle is solvable #include <bits/stdc++.h> using namespace std; #define N 3 // state space t... Add solution
Best helpers
Ranking is empty