Hi, i'm trying to implement a nonrecursive quicksort. I have written this code but it doesn't work. It simply doesn't sort the array. Can you give same advice?
void quicksort_it(int...
Type: Posts; User: |deep|
Hi, i'm trying to implement a nonrecursive quicksort. I have written this code but it doesn't work. It simply doesn't sort the array. Can you give same advice?
void quicksort_it(int...
He means that if he ever writes the code of a operation system what kind of a compiler he will use to compile it.
The answer is:
When you write one, you'll probably know.
You should go and learn some data structures(especially linked lists and binary trees) to practice a lot of recursion problems.
Some very good problems are in Stanford computer science library...
All of the books are for intermediate programmers. If you're new to c++, then get a more basic book. Deitel is fine, but if you don't have any programming background, then go get some 21 days stuff...
I finally got allegro installed in my computer. I tried it for MSVC++ and Borland 5.0 but there were always errors like unresolved external, missing '}' in allegro.h (??) etc. I got it now working...
Try system("cls")
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int x = 0;
int y = 0;
Is the clrscr() function not working? If the problem is that, it can depend on your compiler. (Maybe it's not supporting clrscr())
Indicate your error(s) so others can understand the problem.
You're right. The error is on these pointers. I created an additional struct type and replace string with char*:
struct ArrayNode
{
bool IsQuestion;
char *info;
}
and I used natural...
Yeah, you can use the approach strategy above. it's a very clever idea. Construct a class like above but also include a member function that always sets the data included in the class higher than...
You can flag a value so that it presents positive infinity, for example if you deal with only positive numbers, then -1 can be positive infinity.
read faq.
My program deals with the following structs:
struct NodeType
{
bool IsQuestion;
string info;
NodeType* right;
NodeType* left;
};
ok now. Go to start. click run. type cmd in it
then type c:\borland\bcc55\bin, then type bcc32 blahblah
by the way,you must also save your code into this folder.
There is one more thing, you set...
I think you're using Borland c++ compiler 5.11 (the free one).
then open a command window, go to the borland\bcc55\bin directory and type it there
command window = dos window
ok?
If you have some input like
00|01|02 then you cannot use it. Instead take the whole thing into an array and then separate the integers.
[CODE]
int main()
{
ifstream inFile;...
Save your code as blahblah.cpp in your borland\bcc55\bin directory and type bcc32 blahblah.
Actually there is a more efficient and short way to do this: If the numbers in response array range from 1 to 9, then :
for(int i=0;i<responsesize;i++)
frequency[response[i]]++;
Then...
As fart as I know, there isn't a way to do that because the memory for this array is located at compile time if you do not use dynamic allocation with new.
But you can flag the elements indicating...
No, but you can do that using preprocessor statements like
//This prevents const.h to be twice included
#ifndef _CONST_H_INCLUDED
#include <const.h>
#endif
You are declaring your function
void SetBoard(char board[][79], SHIP* player);
before you declare your struct SHIP. Correct code is:
#include <iostream.h>
#include <conio.h>
There is another error in your code:
This:
for(int x=0;x<100;x+1)
must be like this:
for(int x=0;x<100;x++)