课程: C# Practice: Generic Collections

What you should know - C#教程

课程: C# Practice: Generic Collections

What you should know

- [Instructor] This is a code challenge course where you get to prove your skills by writing code to solve the proposed challenges. There are six challenges in this course. Before you write the code, let me provide some context. What do you need to know? I'll tell you what kind of challenges are in the course, the skills you'll need to demonstrate and some resources where you can acquire the necessary knowledge. The theme for this course is the .NET generic collections. There are a lot of collection types available. For the challenges, you'll work with some of them. Here's a breakdown of the challenges. You'll work with the list<T> specifically with the insertion logic. Next is the dictionary class. You'll be tasked to find matching items in multiple dictionaries and combine them into a new generic list. There is one using the PriorityQueue, a special kind of queue. The challenge is to change the priority levels of items as you add them to the queue. For another task, you'll work with array slicing. That's where you get a contiguous subset of an existing array. The challenge posed in this course is to slice multiple areas in an array and combine them into a new array. Then do it again with a generic list. There is a conversion challenge, taking an existing list and converting and transforming all the items into a new type. Finally, there is a challenge based on the hash set which is an optimized collection of unordered unique elements. It provides fast lookups and high performance set operations and I think it's underutilized in .NET code. You'll get a chance to use it in the course. To find out more about .NET collections check out the "C# Essential Training number two: "Generics, Collections and LINQ" course. It has details on generic types, collections and concurrent collections. There are many ways to work with .NET Collections. If you want, you can use LINQ to solve the challenges, but that's not the focus of this course. You can solve without LINQ if you prefer. I've chosen to use LINQ for some of my solution code, so having some knowledge of LINQ is useful. We've got some courses that Explore LINQ. The one that is most relevant to the code challenges in this course is ".NET Essentials: Working with LINQ". The other courses for XML and databases are not as relevant to the challenges but I think you'll find them interesting if you want a complete picture of LINQ and .NET.

内容