Category: c / c++
Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hour time is 00:00, and the largest is 23:59. Starting …
August 31, 2020
algorithms, Binary Tree, c / c++, C/C++, code, data structure, interviews, Java, programming languages, Python
A Binary Search Tree (BST) is a commonly used data structure that can be used to search for an item in O(LogN) time. A BST has the following characteristics: …
Given an array of integers A, We need to sort the array performing a series of pancake flips. In one pancake flip we do the following steps: Choose an …
Removing duplicate elements and only keeping the unique items in an array (or vector, list) is easy. We can use std::unique method from STL. The std::unique (from algorithms header) …
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 …