120+ interactive Python coding interview challenges (algorithms and data structures). Includes Anki flashcards.
Go to file
2015-06-17 16:38:39 -04:00
arrays-strings Added author and GitHub original repo link to notebooks. 2015-06-17 16:36:55 -04:00
hacker-rank Added author and GitHub original repo link to notebooks. 2015-06-17 16:38:39 -04:00
images Added notebook solving the following: Compress a string such that aabbb becomes a2b3. 2015-05-04 05:54:50 -04:00
linked-lists Added notebook solving the following: Determine if a linked list is a palindrome. 2015-05-19 17:20:56 -04:00
recursion-dynamic Cleaned up code. 2015-05-30 11:06:39 -04:00
sorting-searching Added notebook solving the following: Implement merge sort. 2015-05-29 06:51:37 -04:00
stacks-queues renamed queue-list.py to queue_list.py to be more consistent with python coding guidelines. 2015-06-02 17:43:58 -04:00
.gitignore Added IPython Notebook templates to .gitignore. 2015-05-31 20:26:46 -04:00
LICENSE Updated LICENSE to include notice of third party content. 2015-06-15 16:32:07 -04:00
README.md Fixed repo clone link. 2015-06-16 07:16:11 -04:00


Wikipedia: Quicksort, Merge Sort

algorithms-data-structures

Continually updated IPython Notebooks containing coding problems and solutions (algorithms and data structures).

This repo is a collection of my notes while sharpening my skills tackling coding problems.

Most solutions are in Python.

Index

Arrays and Strings

Notebook Problem Statement
hash-map Implement a hash table with set, get, and remove methods
unique_chars Determine if a string contains unique characters
reverse_string Reverse characters in a string
permutation Determine if a string is a permutation of another
replace_char Encode spaces in a string in-place
compress Compress a string
rotation Determine if a string is a rotation of another

Linked Lists

Notebook Problem Statement
linked-list Implement a linked list with insert, find, delete, and print methods
remove-duplicates Remove duplicates from a linked list
kth-to-last-elem Find the kth to last element of a linked list
delete-mid Delete a node in the middle of a linked list, given access to only that node
partition Partition a linked list around a given value
add-reverse Add two numbers whose digits are stored in a linked list in reverse order
find-loop-start Find the start of a linked list loop
palindrome Determine if a linked list is a palindrome

Stacks and Queues

Notebook Problem Statement
stack Implement a stack with push, pop, and peek methods using a linked list
queue Implement a queue with enqueue and dequeue methods using a linked list
n-stacks Implement n stacks using a single array
stack-min Implement a stack that keeps track of its minimum element
set-of-stacks Implement a set of stacks class that wraps a list of stacks, each bound by a capacity
hanoi Implement the Towers of Hanoi with 3 towers and N disks
queue-from-stacks Implement a queue using two stacks
sort-stack Sort a stack using another stack as a buffer

Sorting and Searching

Notebook Problem Statement
selection-sort Implement selection sort
insertion-sort Implement insertion sort
quick-sort Implement quick sort
merge-sort Implement merge sort

Recursion and Dynamic Programming

Notebook Problem Statement
fibonacci Implement fibonacci recursively, dynamically, and iteratively

Trees and Graphs

[Coming Soon]

Bit Manipulation

[Coming Soon]

Scalability and Memory Limits

[Coming Soon]

Concurrency

[Coming Soon]

HackerRank and TopCoder

Notebook Problem Statement
utopian-tree View problem statement on HackerRank
maximizing-xor View problem statement on HackerRank

Notebook Installation

If you already have Python installed and are familiar with installing packages, you can get IPython with pip:

pip install ipython

Or if you want to also get the dependencies for the IPython notebook:

pip install "ipython[notebook]"

For more details on installation, follow the directions here.

To interact with or to modify elements within the IPython notebooks, you must first clone or download the repository then run the ipython notebook. More information on IPython Notebooks can be found here.

$ git clone https://github.com/donnemartin/algorithms-data-structures.git
$ cd [downloaded repo directory name]
$ ipython notebook

Credits

Contact Info

Feel free to contact me to discuss any issues, questions, or comments.

License

This repository contains a variety of content; some developed by Donne Martin, and some from third-parties. The third-party content is distributed under the license provided by those parties.

The content developed by Donne Martin is distributed under the following license:

Copyright 2015 Donne Martin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.