JS Study Group: Algorithms

Every other week we will be getting together to solve one large or a series of small algorithm puzzles in pairs or small groups. This is a highly interactive and supportive group to explore our understanding of Javascript and different algorithm concepts. We welcome all levels of JS experience!

Typical Agenda

8:00-8:10 - icebreaker/introduction/announcements
8:10-8:20 - present and discuss the algorithm(s)
8:20-9:15 - pair off and solve algorithm(s)
9:15-9:30ish - discuss solutions as a group

Join or login to comment.

  • A former member
    A former member

    Can we ask our own problems next week? Can keep it theoretical!

    September 23, 2013

  • Collen J.

    QuickSort Sorting Algorithm: http://en.wikipedia.org/wiki/Quicksort

    Here is working JavaScript code for the quickSort() algorithm:

    var quickSort = function(data) { if(data.length <= 1) {
    return data;
    }

    var pivot = data.splice(Math.floor(data.length / 2),1); var left = [], right = [];

    data.forEach(function(value) {
    (value < pivot ? left : right).push(value);
    });

    return quickSort(left).concat(pivot).concat(quickSort(right));
    };

    September 23, 2013

  • Peter H.

    Radix Sort!

    var RadixSort = function (list) {
    var getDigit = function(number, index) {
    return (Math.floor(number / (Math.pow(10,index)) % 10));
    } var generateBuckets = function() {
    var buckets = [];
    for (var i = 0; i < 10; i++) {
    buckets.push([]);
    } return buckets;
    } var digit = 0;
    var oldbuckets = generateBuckets();
    var newbuckets = generateBuckets();
    oldbuckets[1] = list; while (oldbuckets[0].length != list.length) {
    for (var bucket = 0; bucket < 10; bucket++) {
    for (var i = 0; i < oldbuckets[bucket].length; i++) {
    var value = oldbuckets[bucket][i];
    newbuckets[getDigit(value, digit)].push(value);
    } } digit++;
    oldbuckets = newbuckets;
    newbuckets = generateBuckets();
    } return oldbuckets[0];
    };

    September 23, 2013

  • Peter H.

    Selection Sort!

    var SelectionSort = function (list) {
    for (var i = 0; i < list.length - 1; i++) {
    var min = list[i];
    var mindex = i;
    for (var j = i; j < list.length; j++) {
    if (list[j] < min) {
    min = list[j];
    mindex = j;
    } }
    list[mindex] = list[i];
    list[i] = min;
    } return list;
    };

    September 23, 2013

  • Gregory H.

    If you are wait listed please come this week anyways!!

    September 23, 2013

  • A former member
    A former member

    Would love to discuss an open problem I have: How to deal cards from a deck in multiple simultaneous games without ever dealing a repeat. It's a N player game with some interesting constraints.

    September 23, 2013

  • A former member
    A former member

    I propose we revisit last week's stable marriage problem. It would be fun to come up with more solutions to the problem and compare them with visualization.

    https://en.wikipedia.org/wiki/Stable_marriage_problem

    September 10, 2013

38 went

Create your own Meetup Group

Get started Learn more
Henry

I decided to start Reno Motorcycle Riders Group because I wanted to be part of a group of people who enjoyed my passion... I was excited and nervous. Our group has grown by leaps and bounds. I never thought it would be this big.

Henry, started Reno Motorcycle Riders

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy