You are given the number of houses and the number of paths.
Each path connects two houses with a given price (it connects both ways).
You have to connect all the houses with the minimal cost. ...
Type: Posts; User: Tobias Mihel
You are given the number of houses and the number of paths.
Each path connects two houses with a given price (it connects both ways).
You have to connect all the houses with the minimal cost. ...
#include<iostream>
#include<conio.h>
using namespace std;
class item{
public:
char name[20];
int price;
void enter(int);
return 5 sorry i pasted wrong
ok i wrote it
int rek(int i)
{
if(i>2)
return -2*rek(i-1)+rek(i-2);
if(i==2) return i;
else return 1;
}
Yeah I tried but the sequence is really weird ...
That's all we were given and the maximum n-th term to be searched for is 6 so it doesn't matter what follows
We have a sequence of numbers "5,2,1,0,1,-2,5,...."
Write a recursive function which returns the 6th number of this sequence.
I have done recursive functions like fibonacci or pow but not something...
How would i calculate a surface that up to 10^5 squares cover. The info you get is xpos,ypos and width for each square. How would you calculate the total surface covered (if any overlap only one...
I must solve that in code but I am wondering how this would be done.
you have 3 integers given X,Y,Z
X is amount of black soldiers
Y is amount of purple soldiers
Z is amount of white soldiers
Calculate how many variations there are if black and white can't stand...
There are variations involved. I know how I would calculate without the obstacles but I don't know how to take the obstacles into the equation or try another path. I just need a general idea how to...
So I got a task from our countries programming team to do this but I have no idea how I could go at it (I'm not looking for a solution in code but just how I could be able to do this in C++)
So...