saifamrkhail / wqupc

Weighted Quick-Union with Path Compression in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weighted Quick-Union with Path Compression in C++

Summary

Weighted Quick-Union with Path Compression (WQUPC) is my implementation of a disjoint-set data structure in C++.

Rationale

I wrote this after taking the Coursera Algorithms 1 class from Princeton University. The class is done in Java, so for fun I decided to write up an implementation in C++.

I thoroughly enjoyed the class and would recommend it to anyone wanting to brush up on their algorithm skills.

Design

This is a mini-library consisting of a single class WQUPC. It uses GNU Autotools and provides a pkg-config file for client ease of use.

The tiny test suite uses Google Test. Make sure you have the proper include and library paths in CXXFLAGS and LDFLAGS, respectively.

Differences with Coursera Java Implementation

Professor Sedgewick uses the method name union, which of course is a keyword in C++. I therefore opted to use the name join instead.

Colophon

Produced with the greatest editor in history.

Double-space
Post full stop
Proper and Correct
Just ask your Pop
- Burma Shave

About

Weighted Quick-Union with Path Compression in C++

License:GNU General Public License v3.0


Languages

Language:Shell 76.4%Language:Makefile 22.9%Language:C++ 0.5%Language:M4 0.1%