# Tagged Questions

50 views

### Path Planning - Greedy Best First Search

I'm working on a path planning algorithm that will be converted to RobotC. I'm trying to optimize it so that it uses the least amount of memory, as the robot it will be implemented on has supposedly ...
47 views

### DSSudokuSolver - A JavaScript Sudoku solving algorithm

I wrote DSSudokuSolver - a sudoku solving algorithm a while back. Is there any possibility that this algorithm can be improved? Original Algorithm: CleanElements = function(comp_ary, Qsudoku){ ...
53 views

### Displaying overlapping blocks using d3js

The code takes in nodes with different start time as input and assigns the position such that they will not overlap. As I have coded with too many loops and conditions. Can anyone review the code and ...
213 views

### Is my algorithm N Log N

I've read the docs online explaining Log N and I do understand that the basic concept of it, but I'm still not sure I've managed to nail it. The problem This exercise is called complementary pairs ...
107 views

### What optimizations should I add to this algorithm?

over the weekend I was perusing the web, and came across the programming problem, finding the longest non-decreasing subsequence in a grid, and I wanted to tackle it. I'm a web developer by ...
54 views

### Is this code for getting the dependency tree of a file correct?

function dep_tree(graph,node,prev_deps){ return uniq(flatten(graph[node].map(function(child_node){ if (contains(prev_deps,child_node)) throw "Circular reference between ...
161 views

### How to optimize this algorithm? (solving systems of linear equations)

I am working on a programming challenge described here: http://www.enigmagroup.org/missions/programming/9/ Basically, you have a 6x6 table where the first 5 columns and rows are comprised of ...
173 views

### Challenge: solution for this deep-iteration JavaScript function dilemma?

Trying to implement a deep-iteration function with some constraints, I've noticed the faster solution is iterating it twice! Any attempt to avoid this resulted in slower code. So, the challenge: can ...
399 views

### Solving a 7x7 maze puzzle

i came across this fun puzzle while being on vacation. It was designed by Robert Abbott and painted into the grass of a Wisconsin farm. Robert succeeded into making it seem really easy to solve. ...
513 views

### Javascript PriorityQueue based on object property

I am pretty new to javascript development and its temperaments. I wrote this class which is a priority queue based on a numeric property of any object. As far as I can tell, the following code is ...
698 views

### How can you map the differences between JavaScript objects?

The reason I want to do this is that the JavaScript objects are created from XML elements and if the element has changed I want to be able to detect that change in the JavaScript objects. So I wrote a ...
221 views

### Snippet of custom array.indexOf that supports nested arrays

I recently wrote a snippet to make a custom array.indexOf but with nested array support in addition to allow using a nested array as needle. For example, it correctly returns the index 3 in this ...
1k views

### Fisher-Yates shuffle algorithm in javascript, modern and inside-out versions

I've implemented two different versions of the Fisher-Yates shuffle in javascript, and I'd like to know if I've made any mistakes. I'm creating a deck of playing cards. I'm interested in these ...
675 views

### Rearrange elements in two-dimensional array spiral order

Recently I was asked to write algorithm to rearrange elements in two-dimensional array in spiral order. Input array: Output array: [ 1, 2, 3, 4] [ 1, 2, 3, 4 ] [ ...
178 views

### Help optimize my HTML/JS Game Engine

So, recently, I've been working on a JS/HTML5 Game Engine. Right now I'm calling it DimSumJs, because like DimSum isn't a full meal, my framework still runs too slowly to make a full game (it can only ...
239 views

### How can I improve this JavaScript DOM-manipulation data-structure/algorithm?

(this is a crosspost from StackOverflow, it was suggested I asked here) Goal I've got a DOM with about 70 elements on it (divs with some content) . I need to move and toggle the display of those ...
5k views

### Efficient Binary Search

My implementation: Array.prototype.binarySearchFast = function(search) { var size = this.length, high = size -1, low = 0; while (high > low) { if (this[low] === search) ...