/CTCInterview

Cracking the Coding Interview - Notes & Programs

Primary LanguagePython

CTCI

  • Personal Notes & Code for Book

Table of Contents

  • CHP1 - Arrays & Strings
    • 1.1 - Is Unique
      • TASK: Algorithm to determine if string has all unique characters.
      • Cannot use additional data structures.
      • Good idea to ask if input is ASCII or Unicode.
      • Idea 1:
        • loop through all the letters checking it against each other
        • O(n^2)
      • Idea 2:
        • sort the string then check for identical neighbors
      • Idea 3:

  • 1.2 - Check Permutation
    • TASK: Given 2 strings, check if one is a permutation of the other.