Spiga

ALGORITHM TO DETERMINE STRING CONTAINS UNIQUE CHARACTER

Implement an algorithm to determine if a string has all unique characters. With and without using extra additional data structures

/**
* Implement an algorithm to determine if a string has all unique characters.
* With and without using extra additional data structures?
*
@author Sonu Mishra
*/
public class StringContainsUniqueCharacter {
/**
* Without using extra DS.
*  Ignoring int variable. Time complexity is
* O(n), where n is the length of the string, and space complexity is O(n).
* We can reduce our space usage a little bit by using a bit vector.We will
* assume, in the below code, that the string is only lower case ‘a’ through
* ‘z’.This will allow us to use just a single int
*
@param str: String to check
@return : true/false
*/