Category: implementation
The Union-Find (Disjoint Set) is a commonly-used algorithm that can solve e.g. Minimal Spanning Tree. The following is a Java implementation of a Union-Find Class. package com.helloacm; public class …
The following is a simple counter implementation that is based on PHP, if you have a small site of low traffic, or you just want to have a very …
The GUID represents an unique identifier, and you can get the API to generate one for you. In WSH (Windows Scripting Host) environment, it turns out to be very …
We all know that the 32-bit signed/unsigned integer takes 4 byte while 64-bit signed/unsigned integer takes 8 bytes to store. If there is a very big integer which is …
Question: How to determine if a linked list has a cycle? The Singly Linked List is defined as follows: struct ListNode { int val; ListNode *next; ListNode(int x) : …