Learn how to use jagged arrays with different internal array sizes in C# so that you can represent, organize, and access more uneven data in your programs.
- [Instructor] Let's try an example…of jagged arrays in C#.…The first thing we're going to do is scroll down,…select our language, C#,…and then delete the code inside of here.…To create our jagged array,…the first thing we need to do is declare it.…In this case, we'll write int,…square bracket, square bracket, jagged…and have this equal a new integer array that has three rows.…We won't put a number in the column slot because, again,…the number of columns is not fixed.…
Each array within the jagged array can have as many columns…as it wants, however,…in this case our array will only have three rows.…Inside of this jagged array,…the first thing we're going to do is set row one…and that this case is going to be at index zero…and this row is going to have a new integer array…that has two spots inside of it.…It can contain two integers.…The first integer,…which is also going to be at row zero and slot zero,…is going to have the value eight.…
The second item in this row is going to be 10…and we're setting that on line 12 here.…
- 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.