binary trees in c++???

This is a discussion on binary trees in c++??? within the C++ Programming forums, part of the General Programming Boards category; hi there, im pretty new to C++ but i have to do a project which allows a number of product ...

  1. #1
    Unregistered
    Guest

    Arrow binary trees in c++???

    hi there,
    im pretty new to C++ but i have to do a project which allows a number of product items to be stored in the info part of each node.
    e.g.
    11014 milk 1.99

    this is an example of a product (bar code, description, price) in a grocery store checkout system. the items are sorted by the barcode numbers

    any pointers would be appriated,
    thanks

  2. #2
    Registered User matheo917's Avatar
    Join Date
    Sep 2001
    Posts
    279
    you have stated a word "node", which brings me to think that you are working with "linked lists"....is that so...??

    if so.....
    you would most likely want to create a class with all those 3 attributes as private data members of a function, and provide public functions that will be able to access them....

    if we are speaking of linked lists there's a lot more to it than it seams...
    (pointers and most likely dynamicly allocated members)

    considering you are new to c++ you probably don't know templates, in this case we would have to design a "home-made" function that will be able to sort all the objects of this paritcular class based on the "barcode number"
    it is not that difficult however it requires more planning... i guess i would need little more info from you if i would have to help you ....

    Regards,
    matheo917

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    5

    Thumbs up

    hi matheo917,

    thanks very much for your interest in my code problem.

    the specification is:
    i have to implent a container as a class to support the following:
    insertion of product,
    retrieval of product,
    deletion of product,
    serialisation to/from iostreams,
    and determining tho number of products in the container.

    The container is to retain a stored repository of the products - keyed on the product code. The class must be incorporated into a test application that exercises the facilities. This must include the loading of a text file of product data (unsorted) and a generation of a sorted version of the file. It should also demonstrate searching for and deletion of products from the data structure.

    example of a product item: 11014 butter 1.50


    A number of data structures can be used to meet these requirements including Linked Lists, Double Linked Lists, Binary Search Tree.

    thanking you in anticipation,

  4. #4
    Unregistered
    Guest

    Thumbs up

    i dont no much about anything but what i do know that u need help my sister gives grinds in bedroom assistance if you want give her a call! xxx

  5. #5
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    This person asked an intelligent question, give him an intelligent answer. Post that kind of jokes on general discussion too

    PS: What is her number?

  6. #6
    Registered User matheo917's Avatar
    Join Date
    Sep 2001
    Posts
    279
    ok.......i see what the exact task and its expectations are....... however this requires a lot of work, and if i am correct when i say it's a "homework - project assignment" then you want to make sure that all the requirements are met....
    i have couple of similar programs that i wrote a while back, yet they will not be exactly what you are looking for....

    I would be glad to work with you through out this whole project by helping and guiding you along although I will not write the whole project for you...

    My previous post briefly sums up the gist in this task and should give you an idea on where to get started...... yet i would be interested to see some code if you have any written already....?

    Probably it would be better if you just e-mail me b/c otherwise this post would never end......

    ok.......

    my e-mail is: matheo917@comcast.net

    Regards,
    matheo917

  7. #7
    In The Light
    Join Date
    Oct 2001
    Posts
    598
    howdy,
    i wouldnt mind watching this thread grow, i think it would be a good way to teach others.
    please continue the thread on the public forum.

    M.R.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A Binary Search Tree of... Binary Search Trees...
    By SlyMaelstrom in forum C++ Programming
    Replies: 5
    Last Post: 12-10-2005, 01:12 PM
  2. Binary Trees
    By wvu2005 in forum C Programming
    Replies: 7
    Last Post: 10-15-2005, 04:59 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21