Skip to content

Commit

Permalink
Adds links to written tutorials on raywenderlich.com
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinlauKL committed Oct 22, 2017
1 parent f85748e commit b8d20e6
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Binary Search Tree/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Binary Search Tree (BST)

> This topic has been tutorialized [here](https://www.raywenderlich.com/139821/swift-algorithm-club-swift-binary-search-tree-data-structure)

A binary search tree is a special kind of [binary tree](../Binary%20Tree/) (a tree in which each node has at most two children) that performs insertions and deletions such that the tree is always sorted.

For more information about a tree, [read this first](../Tree/).
Expand Down
3 changes: 3 additions & 0 deletions Boyer-Moore-Horspool/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Boyer-Moore String Search

> This topic has been tutorialized [here](https://www.raywenderlich.com/163964/swift-algorithm-club-booyer-moore-string-search-algorithm)

Goal: Write a string search algorithm in pure Swift without importing Foundation or using `NSString`'s `rangeOfString()` method.

In other words, we want to implement an `indexOf(pattern: String)` extension on `String` that returns the `String.Index` of the first occurrence of the search pattern, or `nil` if the pattern could not be found inside the string.
Expand Down
3 changes: 3 additions & 0 deletions Breadth-First Search/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Breadth-First Search

> This topic has been tutorialized [here](https://www.raywenderlich.com/155801/swift-algorithm-club-swift-breadth-first-search)

Breadth-first search (BFS) is an algorithm for traversing or searching [tree](../Tree/) or [graph](../Graph/) data structures. It starts at a source node and explores the immediate neighbor nodes first, before moving to the next level neighbors.

Breadth-first search can be used on both directed and undirected graphs.
Expand Down
2 changes: 2 additions & 0 deletions Depth-First Search/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Depth-First Search

> This topic has been tutorialized [here](https://www.raywenderlich.com/157949/swift-algorithm-club-depth-first-search)
Depth-first search (DFS) is an algorithm for traversing or searching [tree](../Tree/) or [graph](../Graph/) data structures. It starts at a source node and explores as far as possible along each branch before backtracking.

Depth-first search can be used on both directed and undirected graphs.
Expand Down
3 changes: 3 additions & 0 deletions Graph/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Graph

> This topic has been tutorialized [here](https://www.raywenderlich.com/152046/swift-algorithm-club-graphs-adjacency-list)

A graph looks like the following picture:

![A graph](Images/Graph.png)
Expand Down
2 changes: 2 additions & 0 deletions Heap/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Heap

> This topic has been tutorialized [here](https://www.raywenderlich.com/160631/swift-algorithm-club-heap-and-priority-queue-data-structure)
A heap is a [binary tree](../Binary%20Tree/) inside an array, so it does not use parent/child pointers. A heap is sorted based on the "heap property" that determines the order of the nodes in the tree.

Common uses for heap:
Expand Down
2 changes: 2 additions & 0 deletions Linked List/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Linked List

> This topic has been tutorialized [here](https://www.raywenderlich.com/144083/swift-algorithm-club-swift-linked-list-data-structure)
A linked list is a sequence of data items, just like an array. But where an array allocates a big block of memory to store the objects, the elements in a linked list are totally separate objects in memory and are connected through links:

+--------+ +--------+ +--------+ +--------+
Expand Down
2 changes: 2 additions & 0 deletions Merge Sort/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Merge Sort

> This topic has been tutorialized [here](https://www.raywenderlich.com/154256/swift-algorithm-club-swift-merge-sort)
Goal: Sort an array from low to high (or high to low)

Invented in 1945 by John von Neumann, merge-sort is an efficient algorithm with a best, worst, and average time complexity of **O(n log n)**.
Expand Down
2 changes: 2 additions & 0 deletions Minimum Spanning Tree/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Minimum Spanning Tree (Weighted Graph)

> This topic has been tutorialized [here](https://www.raywenderlich.com/169392/swift-algorithm-club-minimum-spanning-tree-with-prims-algorithm)
A [minimum spanning tree](https://en.wikipedia.org/wiki/Minimum_spanning_tree) (MST) of a connected undirected weighted graph has a subset of the edges from the original graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. There can be more than one MSTs of a graph.

There are two popular algorithms to calculate MST of a graph - [Kruskal's algorithm](https://en.wikipedia.org/wiki/Kruskal's_algorithm) and [Prim's algorithm](https://en.wikipedia.org/wiki/Prim's_algorithm). Both algorithms have a total time complexity of `O(ElogE)` where `E` is the number of edges from the original graph.
Expand Down
2 changes: 2 additions & 0 deletions Queue/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Queue

> This topic has been tutorialized [here](https://www.raywenderlich.com/148141/swift-algorithm-club-swift-queue-data-structure)
A queue is a list where you can only insert new items at the back and remove items from the front. This ensures that the first item you enqueue is also the first item you dequeue. First come, first serve!

Why would you need this? Well, in many algorithms you want to add objects to a temporary list and pull them off this list later. Often the order in which you add and remove these objects matters.
Expand Down
2 changes: 2 additions & 0 deletions Stack/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Stack

> This topic has been tutorialized [here](https://www.raywenderlich.com/149213/swift-algorithm-club-swift-stack-data-structure)
A stack is like an array but with limited functionality. You can only *push* to add a new element to the top of the stack, *pop* to remove the element from the top, and *peek* at the top element without popping it off.

Why would you want to do this? Well, in many algorithms you want to add objects to a temporary list at some point and then pull them off this list again at a later time. Often the order in which you add and remove these objects matters.
Expand Down
3 changes: 3 additions & 0 deletions Tree/README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Trees

> This topic has been tutorialized [here](https://www.raywenderlich.com/138190/swift-algorithm-club-swift-tree-data-structure)

A tree represents hierarchical relationships between objects. This is a tree:

![A tree](Images/Tree.png)
Expand Down
2 changes: 2 additions & 0 deletions Trie/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Trie

> This topic has been tutorialized [here](https://www.raywenderlich.com/139410/swift-algorithm-club-swift-trie-data-structure)
## What is a Trie?

A `Trie`, (also known as a prefix tree, or radix tree in some other implementations) is a special type of tree used to store associative data structures. A `Trie` for a dictionary might look like this:
Expand Down

0 comments on commit b8d20e6

Please sign in to comment.