GoConqr has a new look! Let us know what you think.

Flashcards

Untitled

Lidza Louina Psychology 101 English 1 card

Cards in this deck (1)

  1. 1Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?First question: which characters are we talking about? I'm assuming unicode. Which has more than 120,000 characters.
    First thought: create an array that can hold binary values. All will initially be set to 0. Go thru the string and use the character as a key that maps to the array index. Check if the value is already 1. If not, update the boolean value to 1. If so, break out.
    New idea:
    Implement quick sort, and intercept the value check and merging. If two values are equal to each other, break out.
    Pseudocode solution:
    contains_unique_characters function ( string)
    Checker is 0
    Loop thru length of string

Information

Description
101 Psychology Flashcards on Untitled, created by Lidza Louina on 14/10/2015.
Created by
Lidza Louina
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?