Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

firefly2442

C++ Question

This topic is 6191 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Arrays are a built-in type for C++. Binary Tree''s are made with pointers with functionality suppiled by the developer. Arrays are a rectanglular area of memory that all elements can be indexed by adding on 1*(Object) to get to the next elements memory address. All other structures are spaced throughout the memory. Neither are ''databases'' but rather ''structures''. As with binary tree''s, you can make other structures such as linked-lists, double-linked lists, graphs, and all sorts of goodies.

~Michael Sikora

Share this post


Link to post
Share on other sites
This might be over your head right now, but you can also make a binary tree out of an array:

The root of the tree is element 0, and element 0''s left child is element 1 and its right child is element 2. To get at any nodes left child you use the formula ((2 * i) + 1). To get at the right child you use the formula ((2 * i) + 2) where "i" in both cases is the index of the node you are at starting at 0 for the root.


Anyone, please correct me if I am wrong . . .

Share this post


Link to post
Share on other sites
well , there are libraries that have complex data types that
you can use.

try out the stl library. Its easy to use and the container and iterator concepts are very flexible.



{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!