#### Overview of this book

Explore a new world of data structures and their applications easily with this data structures book. Written by software expert William Smith, you?ll learn how to master basic and advanced data structure concepts. ? Fully understand data structures using Java, C and other common languages ? Work through practical examples and learn real-world applications ? Get to grips with data structure problem solving using case studies
Everyday Data Structures
Credits
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
Data Types: Foundational Structures
Arrays: Foundational Collections
Lists: Linear Collections
Stacks: LIFO Collections
Queues: FIFO Collections
Dictionaries: Keyed Collections
Sets: No Duplicates
Structs: Complex Types
Trees: Non-Linear Structures
Heaps: Ordered Trees
Graphs: Values with Relationships
Sorting: Bringing Order Out Of Chaos
Searching: Finding What You Need

## Tree data structure versus tree data type

In fact, there is both a tree data type as well as a tree data structure, and the two are quite different. So before we go any further, it is important to make a distinction between a tree data structure and a tree data type.

For starters, a data type is only an arrangement of data without any definition of how a collection of that data is to be implemented. On the other hand, a data structure is precisely concerned with detailing how to take a particular data type and create a usable, concrete implementation of that type.

In the case of trees, a tree data type must have a value and some concept of children where each of those children is also a tree. A tree data structure is a group of nodes that are linked according to the pattern of a tree data type.

The two diagrams following show the two types of tree:

• Ordered Tree:

• Unordered Tree:

Therefore each node is a tree, with the potential for child nodes that are also trees. In this chapter, we will be...