Skip to content

Instantly share code, notes, and snippets.

View CITIZENDOT's full-sized avatar
👋
Hey there! I am using Github.

Appaji CITIZENDOT

👋
Hey there! I am using Github.
  • IIT Patna
  • India
View GitHub Profile
@CITIZENDOT
CITIZENDOT / gen_graph.py
Created August 18, 2021 13:28
Quicky generate graphs for Leetcode/Competetive programming
"""
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
@CITIZENDOT
CITIZENDOT / index.html
Created August 16, 2021 09:18
5 Rarely used HTML tags
### Five rarely used HTML tags
<abbr title="Computer Science">CS</abbr>
<bdo dir="rtl">Appaji</bdo>
<kbd>Ctrl</kbd>
<!-- System Output Font -->
@CITIZENDOT
CITIZENDOT / LinkedList.cpp
Created August 7, 2021 16:04
LinkedList with Smart pointers C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
int val;
shared_ptr<Node> next;
Node(int _val) {
val = _val;
next = nullptr;
@CITIZENDOT
CITIZENDOT / main.cpp
Last active August 28, 2021 10:38
Continuous Comparison for C++
#include <iostream>
template <typename T>
class Comparator {
bool result;
T last;
public:
Comparator(bool _result, T _last) : result(_result), last(_last) {}
operator bool() const {
@CITIZENDOT
CITIZENDOT / BST.cpp
Last active April 29, 2024 17:06
Binary Search Tree
#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;