2

Bit Vector Unique Algorithm

C++ algorithm using a bit vector.

An algorithm that determines if there are any duplicate characters in the string.

Usage

./unique [lowercase string]

Explanation

For each character, it calculates a bit position based on the difference between the character's ASCII value and the ASCII value of the first character in the string.

It uses bitwise operations to check if this position in a vector is already set. If it is, this indicates a duplicate letter.

Languages

C++