Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Tuesday, September 22, 2009

Find a fast solution

I came across this problem recently and found it interesting.

Say you got an input array and output array of equal length. The input array has random integers and you need to populate the output array by following this criteria.

The element at index i of the output array will the product of all the elements in the input array, excluding the element at position i.

ie output[k] = Product of i's { i=0..n-1, where i≠k }

Write a code/algo that will work the FASTEST.

cross posted at basicsuncovered.

Sunday, November 9, 2008

git - a stupid content tracker

To start with Source Code Configuration Management is basically tracking your source code with changes made to it. A consistent change will be recorded and can be kept track as a history. In this way there is no single copy of the file. Its maintained as change of change. This is how source code is maintained in any project in both open source and closed source.
"Maintaining code is equally important to writing good code"
Some of the source version control systems that I can think of are CVS, SVN, Perforce and some other commercial ones. I had worked with CVS and SVN extensively. :) In fact was introduced to SVN first and then asked to (cont...)
Cross post: Basics Uncovered

Tuesday, September 9, 2008

Code Review


I cannot resist. :)
Thanks Chax and post disclaimed.