Data Structures and Algorithms Project
Collection of my solutions to various Data Structure and Algorithm problems. Each file is a particular data structure or algorithm written in Python with comment explanations describing the processes taken.
This was done in part with a Data Structures and Algorithm course for the Udacity Full Stack Web Developer Nanodegree co-created by Amazon Web Services, GitHub, AT&T and Google.
- Download Python
- Clone Data Structures Project repository
- In terminal run the file with command python file-name.py
List of Data Structures and Algorithms
- Stack - An ordered collection of items where the addition of new items and the removal of exsisting items always takes place at the same end, (i.e. last in first out).
- Queue - An ordered collection of items where the addition of new items happens at the rear and the removal of exsisting items happens at the front, (i.e. first in first out).
- Deque - A double-ended queue where the addition or removal of items happens at the front or the rear.
- Recursion - A method of solving problems that involves breaking a problem down into smaller subproblems until it can be solved trivially. This algorithm calculates the sum of a list of numbers.
- Unordered List - A collection of items (nodes) where each item holds a relative position with respect to the others. The complexity is linear or O(n) in the worst case.
- Ordered List - A collection of items (nodes) where each item holds a relative position with respect to the others. The complexity is linear or O(n) in the worst case.
- Sequential Search - Searches a list where the items are in sequntial order. The complexity is liner or O(n) in the worst case and constant or O(1) in the best case.
- Binary Search - Serches a list where the items are in sequntial order but starts at the middle item. The complexity is logarithmic or O(log n).
- Bubble Sort - Makes multiple passes through a list and compares adjacent items and exchanges those that are out of order. The complexity is quadratic or O(n2).
- Iteration - A process of repition thats yields results successively closer to a desired result. This algorithm calculates the sum of a list of numbers.
- Odd Even Numbers - A program that checks if a number is odd or even.
- Positive Negitave Numbers - A program that checks if a number is positive or negative.
- Palindrome - An algorithm where a string of characters is inputed is checked whether it is a Palindrome or a word that reads the same forward or backwards.
- Prime Numbers - A program that displays all the prime numbers within an interval.
- Factorial - A program to find the factorial of a number.
- Fibonacci Sequence - A program that displays the Fibonacci sequence up to nth term.