470,830 Members | 1,767 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,830 developers. It's quick & easy.

Help with Chaining

Hello everyone,

I'm trying to recreate the C# dictionary class using binary trees for chaining. I have my binary tree class complete, and all I really need now is to connect my array with numerous instances of the binary tree class.
basically my program works like this:

-enter in a key value pair. The key value pair is stored in an array.

-If the location [key] in the array is occupied by a previous insertion, a new binary tree instance is created and the key value pair is stored there.

So if a collision calls for it, each slot in the array can have its own binary tree.

My problem is, is that I need binary tree instances to be created and named as they are required.

I'm not that experienced with C# or programming in general. The only way I could do this is create a binary tree instance for each array slot manually and give it a unique name. However, since the array's size isn't static that would not work for very long.

I hope this is semi-clear at least. Thanks for an help.
Nov 5 '08 #1
3 1141
9,208 Expert Mod 8TB
Are you writing this in C++ or C#?

If it's not C++ then you are in the wrong forum. Let me know the situation and I can move this thread if necessary.
Nov 5 '08 #2
Sorry! yes I'm in the wrong section. Great start for me here at bytes. If you could move it to a c# forum I'd appreciate it. Thanks
Nov 6 '08 #3
3,652 Expert 2GB
Done and done.
Nov 6 '08 #4

Post your reply

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

Similar topics

7 posts views Thread by pkruti | last post: by
2 posts views Thread by Steve R. Hastings | last post: by
8 posts views Thread by escher4096 | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.