This repo is to house some simple JS resources that can help with understanding the language, OOP and whatever else.
I'll list everything out here one day... there is also a lot of redundant code/backups and blah blah blah that i've kept. one day, this house'll be clean.
Just me messing around with Binary Tree Searches. This file will probably be deleted or moved into the Trees subfolder soon.
These made up all investigation work and examples that were used to understand the different sorting algorithms and big o. These are represented as a single Library below - JHSortLib.js
Example of Dijkstra's Algorithm for finding the shortest path in a graph (collection of nodes and edges).
Misplaced file that covers some basic things to remember, patterns to use and example of memoize.
Example working with a Singly Linked List
Example working with a Circular Linked List
Example of synchronous (non-async) HTTP requests registered via a process queue.
Proof of concept for building a process queue manager to execute synchronous HTTP requests.
First attempt at building a process queue to handle registering/firing off synchronous requests.
I guess this is the "working" (lolz) version of the above queue.js
Heh.. another "working" version of the same queue attempt(s) above, except this time with the added requirement: "If an item in the queue in progress times out, then stop the queue and wait for retry. In that event, continue executing the queue from the point of failure (the item that failed)"
Just some code I was working on for building my own xhrRequest handler (similar to jQuery's $.ajax) but for dealing with a process queue (above)
Started to build an array helper but then just gave up on it for underscorejs.
Example of building a custom exception
Example of using/defining Bitwise Options (Flags & Masks). This is similar to NS_ENUM/NS_OPTIONS in Objective C (enums to everyone else).
Disecting Douglas Crockford's explanation of memoize by use of fibonacci
Playing around with building a hash key generator (to be used with hash maps as key lookups).
Example of forced typecasting to an integer to test for equality. Also includes an example showing how to force typecast to a BOOL.
Trying to build a pure-js Object Cloner (didn't want to use jQuery's clone() - but ended up not needing it anyways so this was stopped mid-build)
John Resig's implementation of "...an onDomReady-function, for situations when frameworks are no-no. It's loosely based on jQuery's implementation of $.ready"
... just ignore and never run this script. heh. was reading up about processing a paragraph of text that did all kinds of different find/replace on text, strings, markdown, etc... It (appears) to be broken and in a state where it will create an infinite cycle loop .. don't run it unless curiosity gets the best of you and you just want to hose your browser/machine.
Example of a binary tree search.
All kinds of stuff in here:
- Sorting an unordered list
- Pre-ordering a Binary Tree
- Tree Builder
- Node Builder
- Search
- etc.
More simplistic example of the above Preorder_Binary_Tree_Traversal.js...
Working with a heap to understand how it works ( stopped during build out. This is where objectClone.js came from in the Toolkits section above).
Not sure that this is an actual working example. However, it is a product of my research into understanding binary trees and searching them.
https://github.com/lifeinafolder/Promises/blob/master/src/Promises.js
A semi-large collection of examples showing a few sorting algorithms written in Javascript, including:
- Heap Sort
- Selection Sort
- Merge Sort
- Insertion Sort
- Bingo Sort
- Pancake Sort
- Quick Sort ( 4 different versions )
- underscorejs - http://underscorejs.org
- jQuery - http://www.jquery.com
Working with nodes and searching through a x-dimensional with single/multiple roots/branches. Not really sure this is working. Grabbed some underscore code for convenience to help in the process and investigation.
- http://www.underscorejs.org
- http://www.topcoder.com
- http://www.geeksforgeeks.org/
- http://www.anylogic.com/anylogic/help/index.jsp?topic=/com.xj.anylogic.help/html/code/Arrays_Colle ctions.html
- http://leetcode.com/
- http://rosettacode.org
- http://c2.com/
- http://jsperf.com/yet-another-quicksort-right/3
- http://bigocheatsheet.com/
- http://www.2ality.com/2012/11/var-statement-rules.html
- http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/
- google.com - Search for Binary Tree, Linked List, Graph Heap, Heap Sort, Algorithms, etc.