Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. please suggest me some good pregram using datastructure.

please suggest me some good pregram using datastructure.

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresc++
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pavarathyRock
    wrote on last edited by
    #1

    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... :)

    D R 2 Replies Last reply
    0
    • P pavarathyRock

      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... :)

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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

      P 1 Reply Last reply
      0
      • P pavarathyRock

        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... :)

        R Offline
        R Offline
        Rozis
        wrote on last edited by
        #3

        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

        P 1 Reply Last reply
        0
        • D David Crow

          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

          P Offline
          P Offline
          pavarathyRock
          wrote on last edited by
          #4

          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};
          
          1 Reply Last reply
          0
          • R Rozis

            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

            P Offline
            P Offline
            pavarathyRock
            wrote on last edited by
            #5

            :) 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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups