Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALGORITHM


  Why Data Structures Matter

Our experience on Day 0 of JPR11 yielded a nice example of the need to choose an appropriate implementation of an abstract concept. As I mentioned in the previous post, we experimented with Michael Barker’s Scala implementation of Guy Steele’s parallelizable word-splitting algorithm (slides 51-67). Here’s the core of the issue.Given a type-compatible associative operator and sequence of values, we can fold the operator over the sequence to obtain a single accumulated value. For example, because addition of integers is associative, addition can be folded over the sequence:...

2,327 0       IMPORTANCE DATA STRUCTURE JPR


  Algorithm: Traverse binary tree

PrefaceThere are three ways to traverse a binary tree based on the traversing order.Pre-Order: Root - Left - RightIn-Order: Left - Root - RightPost-Order: Left - Right - RootTake below binary tree as exampleThe node to be traversed in different order would bePre-Order: A - B - C - D - E - FIn-Order: C - B - D - A - E - FPost-Order: C - D - B - F - E - ABelow are the implementations of different orders for traversing the binary tree.Pre-Order TraversingRecursive implementationNon-recursive implementationIn-Order traversingRecursive implementationNon-recursive implementationPost-Order traversing...

2,322 0       ALGORITHM BINARY TREE


  How Integers Should Work (In Systems Programming Languages)

My last post outlined some of the possibilities for integer semantics in programming languages, and asked which option was correct. This post contains my answers. Just to be clear: I want practical solutions, but I’m not very interested by historical issues or backwards compatibility with any existing language, and particularly not with C and C++.We’ll start with:Premise 1: Operations on default integer types return the mathematically correct result or else trap.This is the same premise that as-if infinitely ranged begins with, but we’ll perhaps end up with some different ...

2,138 0       ALGORITHM NUMBER SYSTEM EMBEDDED SYSTEM


  Surprising applications of math

The comments in the previous post touched on surprising applications of math, so I thought I’d expand this theme into it’s own post. Below I’ll give a couple general examples of surprising applications and then I’ll give a couple more personal applications I found surprising.Number theory has traditionally been the purest of pure mathematics. People study number theory for the joy of doing so, not to make money. At least that was largely true until the advent of public key cryptography. The difficulty of solving certain number theory problems now ensu...

2,106 0       MATH ALGORITHMS NUMBER THEORY DIFFERENTIAL EUQATION


  Will We Need Teachers Or Algorithms?

Editor’s note: This is Part III of a guest post written by legendary Silicon Valley investor Vinod Khosla, the founder of Khosla Ventures. In Part I, he laid the groundwork by describing how artificial intelligence is a combination of human and computer capabilities In Part II, he discussed how software and mobile technologies can augment and even replace doctors. Now, in Part III, he talks about how technology will sweep through education.In my last post, I argued that software will take over many of the tasks doctors do today. And what of education? ...

2,104 0       ALGORITHM DEVELOPMENT TEACHER


  Rediscovering the RSync Algorithm

A:Ok, you’re synchronizing this over the web;and what do you use for the synchronization?B: Oh, we implemented the rsync algorithm.A: uhu. And what do you do with really big files?B: The same.A: And you also synchronise folders?B: Yes.A: And how do you do that?B: we iterate over the folder, using the algorithm on every file, recursing over subfolders.A: Can you try 2 things for me? First, a very large file; and second, a large codebase, and see if it holds.IntroductionFirst of all, I am an admirer of the (original) rsync algorithm. (I think) it was a first stab at file synchronization,...

2,088 0       RESYNC ALGORITHM DISCOVERY