please suggest me some good pregram using datastructure.
-
Hi Friends, I am now trying to learn C++ data structure. Can you guys suggest me some good programs so that I can try that out. Till now I have tried the program's like a dictionary with spell check(using Binary search tree), program to parse a file , create data structure and do some processing on that.......etc... please suggest me some questions like this... If the questions includes use of DS such as tree/LinkedList/graph etc.... then it will be very good.... Thanks in Advance... :)
-
Hi Friends, I am now trying to learn C++ data structure. Can you guys suggest me some good programs so that I can try that out. Till now I have tried the program's like a dictionary with spell check(using Binary search tree), program to parse a file , create data structure and do some processing on that.......etc... please suggest me some questions like this... If the questions includes use of DS such as tree/LinkedList/graph etc.... then it will be very good.... Thanks in Advance... :)
pavarathyRock wrote:
I am now trying to learn C++ data structure. Can you guys suggest me some good programs so that I can try that out.
My favorite was always an RPN calculator.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Hi Friends, I am now trying to learn C++ data structure. Can you guys suggest me some good programs so that I can try that out. Till now I have tried the program's like a dictionary with spell check(using Binary search tree), program to parse a file , create data structure and do some processing on that.......etc... please suggest me some questions like this... If the questions includes use of DS such as tree/LinkedList/graph etc.... then it will be very good.... Thanks in Advance... :)
Some suggestions: create a fast XML-parser, with low memory usage create a program that writes MIDI-files (you will tear your hair out) Show the waveform of a wavefile Create a program that parses an EML-file, including attachments Create a simple interpreter. for example. one that can execute batch-files Write a C-compiler Create a RTF-editor Satisfied? Rozis
-
pavarathyRock wrote:
I am now trying to learn C++ data structure. Can you guys suggest me some good programs so that I can try that out.
My favorite was always an RPN calculator.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
Hi Thanks for suggession, I have started on that. till now I have done this much for infix notation. The algorithm I have tried is "Shunting-yard algorithm". This program is having some problems, that I need to fix...... and you experts can give suggession in good coding practices also....
//--------------------------------------------//
//program.hpp
#include<iostream>
using namespace std;const int maxExpressionLength = 100;
class stack
{
char data[maxExpressionLength];
int top;
public:
stack();
bool push(char input);
bool pop(char & output);
void print();
};//--------------------------------------------//
//------------------------------------------------------//
//program.cpp
#include "program.h"
#include "ctype.h"stack::stack()
{
memset(data, 0, sizeof(data));
top = -1;
}
bool stack::push(char input)
{
if (top >= maxExpressionLength - 1)
{
cout<<"Error : expression size is more than supported\n";
return false;
}
top++;
data[top] = input;
return true;
}bool stack::pop(char &output)
{
if (top <= -1)
{
//cout<<"Error : nothing to pop\n";
return false;
}output = data\[top--\]; return true;
}
void stack::print()
{
if (top == -1)
{
return;
}for (int i = 0; i <= top; i++) { cout<<data\[i\]<<" "; }
}
int strilen(int maxLength, char * string_data)
{
if (NULL == string_data)
{
return 0;
}
for (int i = 0; i < maxLength; i++)
{
if (string_data[i] == 0)
{
return i;
}
}
return maxLength;
}bool isValidOperator(char oper)
{
if ((oper == '^') || (oper == '*') || (oper == '/') || (oper == '+') || (oper == '-') || (oper == '(') || (oper == ')'))
{
return true;
}
else
{
return false;
}
}int presedence(char op1)
{
if (op1 == '^')
{
return 5;
}
else if ((op1 == '*') || (op1 == '/'))
{
return 4;
}
else if ((op1 == '+') || (op1 == '-'))
{
return 3;
}
else
{
return 0;
}
}int main()
{
char expression[maxExpressionLength + 1] = {0};cout<<"Enter the expression\\n"; cin>>expression; //strcpy(expression, "3+4\*2/(1-5)^2^3"); if (maxExpressionLength < strilen(maxExpressionLength + 1, expression)) { cout<<"Error : The size of expression is more than supported\["<<\_\_LINE\_\_<<"\]\\n"; getchar(); getchar(); return -1; } stack obj; char rpnOut\[maxExpressionLength + 1\] = {0};
-
Some suggestions: create a fast XML-parser, with low memory usage create a program that writes MIDI-files (you will tear your hair out) Show the waveform of a wavefile Create a program that parses an EML-file, including attachments Create a simple interpreter. for example. one that can execute batch-files Write a C-compiler Create a RTF-editor Satisfied? Rozis
:) Yes satisfied, may be this is tooooo advanced for me. but I am gonna try it out..... :-D may be i can create an XML parser with high memory usage, then I can optimise it..... and other programs.....okey i will try.