473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Binary Tree Help!!

Hi All,

I am creating a license plate recognition system for my coursework and I need to incorporate a binary tree. The examples that I have seen have been quite general and I am unsure of how my code will work with it.

The code below is what I have produced;

Expand|Select|Wrap|Line Numbers
  1.  
  2. void displayC(CarC* cPtr)
  3. {
  4.     cout << "Car Registration: " <<  cPtr->carRegistration << endl;
  5.     cout << "Car Owner: " << cPtr->carOwner << endl;
  6.     cout << "Owner Address: " << cPtr->carOwnerAddress << endl;
  7.     cout << "Car Manufacturer: " << cPtr->carManufacturer << endl;
  8.     cout << "Car Model: " << cPtr->carModel << endl;
  9.     cout << "Number of Car Doors: " << cPtr->numCarDoors << endl;
  10.     cout << "Number of Car Seats: " << cPtr->numCarSeats << endl;
  11.     cout << "Car Type: " << cPtr->carType << endl;
  12.     cout << "Other Information: " << cPtr->carInformation << endl;
  13. }
  14.  
  15. CarC* buildC(string dataLine)
  16. {
  17.     //extract values from csv line & populate vehicle struct
  18.     //csv line consumed from the right
  19.     CarC* ptr = new CarC;
  20.     ptr->carInformation = extractLastString(dataLine);
  21.     ptr->carType = extractLastString(dataLine);
  22.     ptr->numCarSeats = extractLastInt(dataLine);
  23.     ptr->numCarDoors = extractLastInt(dataLine);
  24.     ptr->carModel = extractLastString(dataLine);
  25.     ptr->carManufacturer = extractLastString(dataLine);
  26.     ptr->carOwnerAddress = extractLastString(dataLine);
  27.     ptr->carOwner = extractLastString(dataLine);
  28.     ptr->carRegistration = extractLastString(dataLine);
  29.  
  30.     return ptr;
  31. }
  32.  
  33.  
I can see some of the code I have used is also in binary tree examples that I have seen but would anyone be able to help me understand how my variables would be implemented?

Thanks in advance!
May 7 '11 #1
0 1173

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jerry Khoo | last post by:
hello, everybody, i am kinda new here, nice to meet u all. Now, i am > cs students and are now facing difficult problems in understanding > what a binary tree is, how it works, and the algorithm...
8
by: Jerry Khoo | last post by:
hello, everybody, i am kinda new here, nice to meet u all. Now, i am cs students and are now facing difficult problems in understanding what a binary tree is, how it works, and the algorithm to...
7
by: pembed2003 | last post by:
Hi, I have a question about how to walk a binary tree. Suppose that I have this binary tree: 8 / \ 5 16 / \ / \ 3 7 9 22 / \ / \ / \
3
by: tsunami | last post by:
hi all; I have an array and want to insert all the elements from this array to a binary search tree.That array is an object of the class of a stringtype which includes overloaded "< > = =="...
5
by: pembed2003 | last post by:
Hi, I have a question about how to walk a binary tree. Suppose that I have this binary tree: 8 / \ 5 16 / \ / \ 3 7 9 22 / \ / \ / \
15
by: Foodbank | last post by:
Hi all, I'm trying to do a binary search and collect some stats from a text file in order to compare the processing times of this program (binary searching) versus an old program using linked...
4
by: Ken | last post by:
I have a binary tree in VB NET and insertions seem to be slow. The program receives data from one source and inserts it into the tree. The program receives data from another source and...
4
by: sake | last post by:
Hey everyone, I need a little help with my binary tree program. The purpose of this program is just an exercise for myself, but for some reason it doesn't work. It's supposed to input words "One"...
2
by: cioccolatina | last post by:
Hey guys, is there anyone who could help me..? I have file ExpressionBinaryTree.java : /** class ExpressionBinaryTree * uses a binary tree to represent binary expressions * does not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.