I did say in the main() function is where the problem is. I am getting a few errors. I altered the code some.......
int main()
{
int getInput(int *input);
int n = 0;
Type: Posts; User: campermama
I did say in the main() function is where the problem is. I am getting a few errors. I altered the code some.......
int main()
{
int getInput(int *input);
int n = 0;
I think I have been working on this too long.....in the Main Function area I can't get this to work, I am sure it is probably something simple but I am not seeing it, are you???
Thanks!!!!
...
Terve Nouneim,
I am also new to programming, but I saw that you said you are Finnish, I work for a Finnish company and I have been to Finland many, many times. Just wanted to say hi. Hope you can...
How about, search the array and if the value is found return the location of the value, that is the value in position 1 or 6 or ?. How do I do that?
Thanks!!
I think the problem was I was showing a result for f(0) and that was not part of this recursive,
f(1)=2, f(2)=2, f(n)=2*f(n-1) + f(n-2)
So I changed my code to just show f(1), f(2), and...
Yes, I know....but I am not supposed to define that many variables, just n>=1. Any ideas?
Ok, not sure how to do that. Would it be another if statement?
I need a way for this recursive to end when the item is not in the list. Can you help? Thanks!!
template <typename T>
class List
{
private:
T * array;//memory for array will be...
This is what I have:
#include <iostream.h>
//f(1)=2, f(2)=2, f(n)=2*f(n-1) + f(n-2)
int f(int n)
{
What can I replace these with?
I would rather change the program to work with my compiler, is this possible?
Of course I would need help! :D
I am using Metrowerks Code Warrior, I had somebody helping me with this. It compiles on his compiler (not the same as mine) but I am getting like 99 errors! Can't open dos.h, and can't open...
Consider the language in the alphabet {a,b} defined by the grammar:
<S> = a<S>a | b<S>b | a | b
What are the 5 character strings in this language. Not sure what this means? Is it:
aa...
Not sure if I am on the right track with the code below. This is what I need, I know I am missing stuff, just not sure how to put it in here!
Write a recursive implementation, the operation should...
Yes it compiles fine but after you enter the string of characters etc. it goes into an infinite loop, I don't know why?
Can anybody see what is wrong with this? It gets stuck in a loop. I think I am too tired!! Thanks!
#include <iostream.h>
#include <string.h> //used for strlen
bool InLanguage(char s[],...
Does the following recurrence relation = 50, am I doing this right?
S(1)=5; S(N)=S(N-1) + 5 for N>1
Would this be the correct order to insert a new node at P into a doubly linked list before the the node pointed to cur. Thanks!
P->Next = Cur;
P->Before = Cur->Before;
P->Before->Next = P;...
I am just supposed to write a recursive function, just not sure if this is "good" or not. If it was in a program would it work?
I am still learning this. Does this look right?
Thanks!!
Void DoIt(int N) {
if ( N > 0) {
cout << N << " ";
DoIt(N + 1);
}
}
Is this what you are looking for? Obviously I had help with this!!
#ifndef NEWSTRING_H
#define NEWSTRING_H
#include <list>
#include <iostream>
using namespace std;
Still trying to figure out how to show the length in case 4:
In case 5: returns 1 (true) if string2 is a substring of string1 and 0 (false). How do I do an if with a substring?
Does anybody know...
I need to make this a recursive implementation, I need a little help.
Thanks!!
void List::insert (int index, ListItemType newItem,
bool& success)
{
...
Case 4 and 5 weren' t there because I am trying to figure out how to do it. I have made an attempt at 4, but not sure how to show the length :confused:
Case 5, I have no idea how to start that...
In this code I got case, 1, 2, 3 in the switch, but I am having trouble with 4 and 5.
#include <iostream>
#include <list>
#include <NewString.h> // NewString class definition
using...