Skip to content

Instantly share code, notes, and snippets.

@Ikhideifidon
Ikhideifidon / heap.py
Created November 28, 2023 11:34 — forked from earissola/heap.py
Heap implementation in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Minimum heap implementation. See [Cormen et al 1999] for formal theory.
* Maintains all elements in a min-heap, such that the minimum element will
* be the top-most key in the heap at all times. Among many other uses, heaps are ideal for
* representing priority queues.
'''
from sys import maxint
from warnings import warn
@Ikhideifidon
Ikhideifidon / Database.java
Created May 28, 2022 16:34 — forked from julianjupiter/Database.java
Sample JavaFX application with MySQL JDBC operation.
package io.github.julianjupiter.javafx;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Database