This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Make sure you have graphviz and pygraphviz installed. | |
By default this draws undirected graphs. | |
Draw directed graphs like below. | |
python3 gen_graph.py --directed | |
Input format: | |
- First line consists of 2 integers, number of nodes (n), number of edges (m) | |
- Next m lines contains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Five rarely used HTML tags | |
<abbr title="Computer Science">CS</abbr> | |
<bdo dir="rtl">Appaji</bdo> | |
<kbd>Ctrl</kbd> | |
<!-- System Output Font --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
struct Node { | |
int val; | |
shared_ptr<Node> next; | |
Node(int _val) { | |
val = _val; | |
next = nullptr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <typename T> | |
class Comparator { | |
bool result; | |
T last; | |
public: | |
Comparator(bool _result, T _last) : result(_result), last(_last) {} | |
operator bool() const { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
/* | |
Memory is managed by Smart Pointers, So, Explicit delete is not necessary. | |
Hence, No memory leak. Check solve() for usage. | |
*/ | |
struct NodeC { | |
shared_ptr<NodeC> left, right; |