Learn how to sort your data using the tools from a given programming language. Understand how to use a comparator to sort custom data types. Discover the trade-offs between searching and sorting.
- Sometimes we'll want to search for multiple elements…in an array within a short period of time.…If we run a linear search…every single time we want to search,…this can take quite a while.…If we know what we're going to search for multiple items,…it might be worth sorting the array first…in order to make each search faster.…Now, how do we sort items?…Well, there's usually a natural order to our data.…For example, if we had an array of numbers,…a sorted version of this array could…have the numbers in increasing or decreasing order.…
With characters and strings,…we can sort in alphabetical order.…A should come before b and b before c and so forth.…To sort items, we can implement a sorting function ourselves…or usually this behavior…is built into the programming language…through a sort function.…Sometimes you'll have to call this method on your collection…of objects in an object-oriented programming language,…or pass it as a parameter to a sorting function.…Now, there are times where there…is not a natural order to your data.…
- 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.