Learn how we can add constraints to abstract data structures in order to make specialized data structures that better fit certain groups of data, and discover how a binary search tree (BST) works.
- A binary tree is a specialized type of tree.…It adds the constraint that each node…has two immediate child nodes.…More terminology here.…We call the child nodes left and right nodes respectively.…The left child node and the right child node…could both be null, both have values,…or one of them could be null.…What happens with a binary search tree, also called a BST?…A binary search tree is also a specialized type…where we add an additional constraint, order.…
In a BST, we keep track of order…and keep a sorted data structure by being particular…about what values are in the left child, right child,…and parent nodes.…Why do this?…It makes the data structure more than just a collection…of stuff strung together.…It's a data structure that naturally stays sorted…without immense amounts of reshuffling…that would be needed in a basic array.…What's the rule?…A left child node must be less than its parent…and a right child node must be more than its parent.…
That rule follows all the way down.…As we insert new nodes with values,…
- 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.