In school we have a really hard problem, and still no one from the students has solved it yet. Take a look at the picture below:
http://d.imagehost.org/0422/mreza.gif
That's a kind of a network of connected points, which doesn't end and each point has its own number representing it. Let say the numbers are like this: 1-23-456-78910-et...
I've written a small application that deals with the private stock market. I store all data in one table (to simplify problem) with following columns:
ID, TransactionType, Quantity, Numbers From, Numbers Too, Client ID, Date
1, Buy, 100, AB1000, AB1099, 5, 2009-01-30
2, Sell, 100, AB1000, AB1099, 5, 2010-01-01
3, Buy, 40, AB500...
I'm using a Segment to Segment closest approach method which will output the closest distance between two segments of length. Each segment corresponds to a sphere object's origin and destination. The speed is simply from one point, to the other.
Closest Approach can succeed even when there won't be a real collision. So, I'm currentl...
A while back I wrote a simple python program to brute-force the single solution for the drive ya nuts puzzle.
The puzzle consists of 7 hexagons with the numbers 1-6 on them, and all pieces must be aligned so that each number is adjacent to the same number on the next piece.
The puzzle has ~1.4G non-unique possibilities: you have 7! o...
At class we found this programming problem, and currently, we have no idea how to solve it.
The positive integer n is given. It is known that n = p * q, where p and q are primes, p<=q and |q-k*p|<10^5 for some given positive integer k. You must find p and q.
Input:
35 1
121 1
1000730021 9
Output:
5 * 7
11 * 11
10007 * 100003
...
I don't want you to solve this problem for me, i just want to ask for some ideas.
This is the input below, and it represents a map. The 'x' represents land, and the dots - water. So with the 'x' you can represent 'islands' on the map.
xxx.x...xxxxx
xxxx....x...x
........x.x.x
..xxxxx.x...x
..x...x.xxx.x ...
I am trying to write my own Game of Life, with my own set of rules. First 'concept', which I would like to apply, is socialization (which basicaly means if the cell wants to be alone or in a group with other cells). Data structure is 2-dimensional array (for now).
In order to be able to move a cell to/away from a group of another cells,...
I can't solve it:
You are given 8 integers:
A, B, C representing a line on a plane with equation A*x + B*y = C
a, b, c representing another line
x, y representing a point on a plane
The two lines are not parallel therefore divide plane into 4 pieces.
Point (x, y) lies inside of one these pieces.
Problem:
Write a fast algorithm tha...
This is not a technical question, but rather a social and methodical one. I am a computer sciences student and I usually have really tough programming assignments. I don`t know if it is only happening to me but sometimes, particularly when deadline is approaching, i find myself in a harsh situation. I cannot find my mistake in the code o...
Dont know whether this is a duplicate, but this was an interview question asked to me. Given an array of random numbers and -1 placed inbetween, I have to compact the array meaning all the -1s are to be replaced and the final output should be the last valid index with the fresh array. For example.
Input:
3 4 -1 -1 -1 5 8 -1 8
Output:
3 ...
I've seen some jobs that require nhibernate knowledge, as well as numerous questions on stack. I found another question that pointed me to Summer Of NHibernate and I am watching the videos now. However it has no introduction explaining why NHibernate was created and what problem is solves. By looking on wikipedia, I can see vaguely what ...
I am a reasonably experienced developer (.NET, c#, asp.NET etc) but I'd like to hone my problem solving skills. I find that when I come up against a complex problem I sometimes implement a solution that I feel could have been better had I analyzed the problem in a different way.
Ideally what I am looking for is a resource of some type t...
I'm looking for an algorithm in c# that solves a combinatorics problem:
Assume i have the objects 1,2,3,4
I want to get all possible ways to group these object in multiple groups, that each time contain all objects. Order is not important. Example:
<1,2,3,4>
<1,2 / 3,4>
<1,3 / 2,4>
<1,4 / 3,2>
<1,2,3 / 4>
<1,2,4 / 3>
<1,3,4 / 2>
<2...
The user can enter a math problem (expression) like 5 + 654, 6 ^ 24, 2!, sqrt(543), log(54), sin 5, sin(50). After some reformatting (e.g. change sin 5 into sin(5)), and doing an eval, PHP gives me the right result:
$problem = "5 + 5324";
eval("$result = " . $problem);
echo $problem . " = " . $result;
However, this is quite unsafe:
/...
I was looking at some examples in microsoft site about linq and I see an example that I need to modify!
http://msdn.microsoft.com/en-us/vcsharp/aa336758.aspx#SelectManyCompoundfrom3
public void Linq16()
{
List customers = GetCustomerList();
var orders =
from c in customers
from o in c.Orders
where o.OrderDate >= new Da...
Could you please share some good books, blogs, sites on practical problem decomposition, thanks
P.S. Please only practical ones not the scientific/theoretical resources.
...
Ok so here's what i have so far:
#include <stdio.h>
#include <math.h>
//#define PI 3.14159
int factorial(int n){
if(n <= 1)
return(1);
else
return(n * factorial(n-1));
}
void McLaurin(float pi){
int factorial(int);
float x = 42*pi/180;
int i, val=0, sign;
for(i=1, sign=-1; i<11; i+=2){
sign *= -1; // alternate...
I have a situation where I need to perform several small (but similar) tasks. I can think of two ways to achieve this.
First Approach:
function doTask1();
function doTask2();
function doTask3();
function doTask4();
Second Approach:
// TASK1, TASK2, ... TASK4 are all constants
function doTask(TASK) {
switch(TASK) {
case ...
Every time I start a hard problem and if can not figure out the exact solution or can not get started, I get into this never ending discussion with myself, as below:
That problem
solving/mathematics/algorithms skills
are gifted (not that you can learn
by practicing, by practice, you only
master the kind of problems that you
already ha...
I was going though problems on graph theory posted by Prof. Ericksson from my alma-mater and came across this rather unique question about pigeons and their innate tendency to form pecking orders. The question goes as follows:
Whenever groups of pigeons gather,
they instinctively establish a pecking
order. For any pair of pigeons...