Skip to content

Instantly share code, notes, and snippets.

View drew138's full-sized avatar
🎯
Focusing

Andres Salazar drew138

🎯
Focusing
View GitHub Profile
@drew138
drew138 / Heap.py
Last active January 9, 2023 20:00
Heap Implementation
class Heap:
def __init__(self, key, arr=[]) -> None:
self.arr = arr
self.key = key
def add(self, element) -> None:
self.arr.append(element)
self.heapify_up()
def pop(self):
@drew138
drew138 / Kosaraju.cpp
Last active November 12, 2022 12:16
Kosaraju's Algorithm - Strongly Connected Components
#include <bits/stdc++.h>
#include <iostream>
typedef std::unordered_map<int, std::vector<int>> mapiv;
typedef std::vector<std::vector<int>> vvi;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
using namespace std;
void dfs1(int node, vb &seen, mapiv &adjacency, vi &stack)