Results 1 to 1 of 1
- 04-17-2011, 04:57 PM #1Member
- Join Date
- Feb 2011
- Rep Power
How to insert node to tree while comparing string instead of int
I want to create a program that insert phone record to a binary search tree...
The record accept name and phone number as input, so when i want to compare the data(key), which is the string type name, i have to compare it in alphabetical order.
For example when i insert Kevin to the tree, Aaron will be the first node, and Brandon will be inserted again to the tree, the program will compare these 2 strings and insert to the left node if the alphabet is less than the first node. Does anyone know how to compare them? I know the equal method is to compare the string but is only for same name. I need help immediately because I have to pass up this assignment at thursday.
- By malaguena in forum Advanced JavaReplies: 0Last Post: 03-12-2011, 06:57 PM
- By ni4ni in forum AWT / SwingReplies: 1Last Post: 03-11-2011, 06:21 AM
- By visiau in forum Advanced JavaReplies: 1Last Post: 08-24-2009, 11:41 AM
- By R O C K Y in forum XMLReplies: 0Last Post: 02-18-2009, 06:20 AM
- By Avdhut in forum AWT / SwingReplies: 2Last Post: 06-03-2008, 09:07 PM