github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

gautamrege / short_circuit

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 10
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

RPCFN#3 Find out redundant resistors in a closed circuit — Read more

  cancel

http://www.joshsoftware.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added Rainer Thiel's result of auto_check. 
ashbb (author)
Wed Nov 25 07:43:15 -0800 2009
commit  1e06b84058e47ba9d3724b7fb3d8c1943066225c
tree    fa8d21597328a3e97f9ffdf4e55aa4b214cff0ef
parent  8b949dde12aa15e2dd1472d39de58566105d1b7f
short_circuit /
name age
history
message
file .gitignore Loading commit data...
file README
directory bin/
file circuit_diagram.png
directory lib/
file short_circuit.gemspec
directory solutions/
directory test/
README
Short-Circuit !!

Given a closed electrical circuit, we need to identify the redundant elements.
For the sake of simplicity, we shall assume only resistors between various 
points. Electricity will flow through the path of least resistance!
Source of electricity is A and the end-point is G.

The aim of the program is to find the redundant resistors.
 
As shown in the diagram we can 'translate' load between points
into any simple data structures. For example:

[
  [ 'A', 'B', 50 ],
  [ 'A', 'D', 150],
  [ 'B', 'C', 250],
  [ 'B', 'E', 250],
  [ 'C', 'E', 350],
  [ 'C', 'D', 50],
  [ 'C', 'F', 100],
  [ 'D', 'F', 400],
  [ 'E', 'G', 200],
  [ 'F', 'G', 100],
]

Feel free to use ANY other data structure as long as assumptions are simple
and understandable.

The source and the end-point may be hard-coded in the script or can be taken as 
command line parameters, whichever you feel is convinient.

In the above example, the output expected MUST be the following array of arrays:
[ 
  [ 'A', 'B', 50 ],
  [ 'B', 'C', 250],
  [ 'B', 'E', 250],
  [ 'C', 'E', 350],
  [ 'D', 'F', 400],
  [ 'E", 'G', 200],
]


Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server