Reynald walks through a detailed example of the linear search algorithm. 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.
- [Instructor] So there are areas in dot net where you can…invoke linear searches.…One example is invoking index of.…And I have a simple program here that has…a collection of actors.…And we're going to invoke index of…our actor Madonna.…Now in case you're wondering, hey, Madonna's a singer…well, she's actually been in movies,…so I think of her as an actor.…So let's go ahead and…check the definition of index of.…
And you'll see that if we…expand the plus sign…and read the description…it searches for this specified object…and returns the zero base index…of the first occurrence.…So just like how we did an our custom version…it iterates through every slot of the collection…until it hits the one that it finds…and then returns the value.…Right below our main method we have…a straightforward printout method…that iterates through the collection…and writes it out to the console.…
So, let's go ahead and run.…That's not the output that we're expecting because…I did not set linear search as a start up project.…So let's go ahead and do that.…
- 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.