Discover the advantages and disadvantages of tree data structures so that you know when they best fit your data. Learn the runtime complexity of various tree operations.
- Just like all of the data structures we've seen before,…sets, binary search trees,…and heaps all have their pros and cons.…Sets are great if you need to constantly check…if a certain value exists in the set…and do not need duplicate values.…In any other situation,…you might want to use a different data structure.…Sets are intentionally limited,…so there isn't much more you can do with them.…If your data has an order…and you will be inserting, deleting,…searching and accessing items a lot,…then binary search trees are great.…
They maintain sorted order…while staying fast for insertion, deletion and accessing.…If the tree is balanced,…then it take O of log N time…because with every node we encounter,…we eliminate another half of the tree.…If unbalanced, then it could take up to linear time…because each node could all be on the one side.…However, there is some overhead here…because of their creation and management…and also the idea of continuously rebalancing the tree,…so it's important to keep that in mind.…
Heaps are a type of binary tree…
- Data types: Booleans, numbers, strings, and more
- Multidimensional arrays
- Jagged arrays
- Search and sort arrays
- Linked lists
- Stacks and queues
- Hash functions and hash tables
- Trees and graphs
Skill Level Intermediate
Understand data structures1m 25s
1. Introduction to Data Structures
4. Stacks and Queues
5. Hash-Based Data Structures
6. Trees and Graphs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.