Reynald walks through a detailed example of the binary search algorithm built in .NET. The purpose is so the student familiarizes themselves with the built-in version of this concept in .NET. Reynald talks through the API and some executions of them. After having created a custom version of the algorithm, the student should have a better understanding as to what’s happening behind the scenes in the built-in version in .NET.
- [Speaker] Now binary search algorithms are built in…within C# and some of its classes.…One of them is the array class.…So, I just wanted to go ahead…and show a very simple example.…I went ahead and created an array of some dinners,…various types of dinners that I enjoy,…and I'll write out the content…and of course we talked about the importance of using…a binary search when it is sorted,…only when it is sorted,…or otherwise you could not do a binary search.…
So after writing out the content that's unsorted,…I go ahead and use the sort feature on the array class…that's on line 28 there,…and then write out the content to the screen.…And then on line 36 is what's relevant to us.…Invoking binary search.…And once again you can right-click and go to definitions…and see all the variations of it.…Now back to our code here,…so we essentially do a binary search…for two types of dinners,…one is a beet salad on line 36…and the other is for a tuna melt on line 40.…
Then I have a method just to display the content,…which is based on the results…
- Working with linked lists
- Creating a stack
- Defining a queue
- Performing a binary search
- Finding target values with a linear search
Skill Level Beginner
1. Algorithms and Data Structure Overview
Reasons for this course1m 26s
2. Linked List
5. Binary Search
6. Linear Search
- 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.