Join Simon Allardice for an in-depth discussion in this video Introduction to tree data structures, part of Foundations of Programming: Data Structures.
- View Offline
…The idea of a tree data structure in its most…generic sense is that we have a collection of objects.…For the moment, let's call them nodes.…They have connections, they have links between each other.…Oh, okay, we already talked about a data structure made…of multiple nodes and links when we've talked about linked lists.…But in a linked list, we always go from one node to…a single specific next node, to the next node, to the next node.…Even if we can traverse the list back and forth, this is a fixed sequence.…
But when we have a tree, the difference is that…each node might linked to one, or two, or more nodes.…And while we could represent this visually in all sorts…of confusing ways, the best visual representation is a tree structure.…Now, how these objects are physically allocated in memory is unimportant.…This is a logical data structure we're talking about.…It's not about whether these are taking up contiguous areas in your RAM.…It doesn't matter.…This is a way for us to think about things and make sense of complexity.…
Starting with simple ways of grouping data like arrays and structs, together you'll explore gradually more complex data structures, like dictionaries, sets, hash tables, queues and stacks, links and linked lists, and trees and graphs. Simon keeps the lessons grounded in the real world and answers the "why" behind many data-structuring decisions: Why use a hash table? Why is a set useful? Why avoid arrays? When you're finished with the course, you'll have a clear understanding of data structures and understand how to use them in whatever language you're programming in, today or 5 years from now.
- What is a data structure?
- Using C-style structs and arrays
- Sorting and searching arrays
- Working with singly and doubly linked lists
- Using stacks for last-in, first-out (LIFO) structures
- Using queues for first-in, first-out (FIFO) structures
- Working with hash tables
- Understanding binary search trees (BSTs)
- Learning about graphs