Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drvinceknight/chapter_7_of_comp_sci_illuminated
Some code I've scribbled down from the pseudo code in CH7 of "Computer Science Illuminated" by Dale and Lewis
https://github.com/drvinceknight/chapter_7_of_comp_sci_illuminated
Last synced: about 1 month ago
JSON representation
Some code I've scribbled down from the pseudo code in CH7 of "Computer Science Illuminated" by Dale and Lewis
- Host: GitHub
- URL: https://github.com/drvinceknight/chapter_7_of_comp_sci_illuminated
- Owner: drvinceknight
- Created: 2013-05-24T12:57:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-24T13:20:01.000Z (over 11 years ago)
- Last Synced: 2024-06-20T00:45:58.333Z (6 months ago)
- Language: Python
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Repo containing some code relevant to Chapter 7 of the excellent [Computer Science illuminated by Dale and Lewis book](http://www.amazon.co.uk/Computer-Science-Illuminated-Nell-Dale/dp/1449672841/ref=sr_1_1?ie=UTF8&qid=1369398877&sr=8-1&keywords=computer+science+illuminated).
This repo contains 8 simple scripts that cover 3 basic ideas in computer science:
1. Search algorithms
2. Sorting algorithms
3. The above using recursion# Search algorithms
There are two scripts here:
- `square_root.py`, this doesn't have anything to do with search algorithms but is featured in the book as an example of of writing pseudo code so I've included it. More information on the sequence used can be found at [this wiki page](http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method).
- `binary_search_for_sorted_array.py`, a [simple iterative binary search algorithm](http://en.wikipedia.org/wiki/Binary_search_algorithm).# Sorting algorithms
There are three scripts here:
- `selection_sort.py`, a [simple selection sort algorithm](http://en.wikipedia.org/wiki/Selection_sort).
- `bubble_sort.py`, a [simple bubble sort algorithm](http://en.wikipedia.org/wiki/Bubble_sort).
- `insertion_sort.py`, a [simple insertion sort algorithm. Insertion is a simple modification of bubble sort which make it quite efficient](http://en.wikipedia.org/wiki/Insertion_sort).# Recursive algorithms
Recursion is a very powerful idea in computer science that allows for a major speed gain in programming. Here are a couple of scripts that make use of recursion.
- `recursive_factorial.py`, a [simple algorithm that calculates the factorial of a number using recursion](http://en.wikipedia.org/wiki/Recursion#Recursion_in_computer_science).
- `recursive_binary_search_for_sorted_array.py`, a [modification of the above binary search algorithm that makes use of recursion](http://en.wikipedia.org/wiki/Binary_search_algorithm).
- `quick_sort.py`, an [efficient sorting algorithm](http://en.wikipedia.org/wiki/Quicksort).# License Information
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/) license. You are free to:
* Share: copy, distribute, and transmit the work,
* Remix: adapt the workUnder the following conditions:
* Attribution: You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
* Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.When attributing this work, please include me.