Reynald walks through a detailed example of the stack data structure 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.
- [Instructor] So, .NET has its own implementation…of the stack class and I want to go ahead…and demonstrate this by walking through…some of this code here.…As you could see here, we have a method call DemoStack…and we create a collection with some names in a stack.…We do this by invoking Push for each instance.…Then right below, what we're going to do is just…print out to the Console the names…by iterating through the collection.…
On Line 34, we will invoke Pop for one of the items…and then check to see what's going to be…the next item by invoking Peek.…That's done on Line 36.…Then on 37, we go ahead and Pop again.…On Line 40, we create a copy of the stack…using the two array method and the constructor…that accepts an i innumerable, which lets us…pass in an array.…And below that, we have a foreach loop that iterates…through and writes out the content…of the first copy to the Console.…
On 48, we create an array twice the size of the stack…and copy the elements of the stack…starting at the middle of the array.…On Line 51, we create a second stack and then…
- 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.