Book Image

C# Data Structures and Algorithms

By : Marcin Jamro
Book Image

C# Data Structures and Algorithms

By: Marcin Jamro

Overview of this book

Data structures allow organizing data efficiently. They are critical to various problems and their suitable implementation can provide a complete solution that acts like reusable code. In this book, you will learn how to use various data structures while developing in the C# language as well as how to implement some of the most common algorithms used with such data structures. At the beginning, you will get to know arrays, lists, dictionaries, and sets together with real-world examples of your application. Then, you will learn how to create and use stacks and queues. In the following part of the book, the more complex data structures will be introduced, namely trees and graphs, together with some algorithms for searching the shortest path in a graph. We will also discuss how to organize the code in a manageable, consistent, and extendable way. By the end of the book,you will learn how to build components that are easy to understand, debug, and use in different applications.
Table of Contents (14 chapters)

Chapter 2. Arrays and Lists

As a developer, you have certainly stored various collections within your applications, such as user data, books, and logs. One of the natural ways of storing such data is by using arrays and lists. However, have you ever thought about their variants? Have you heard about jagged arrays or circular-linked lists? In this chapter you will see such data structures in action, together with examples and detailed descriptions. That is not all, because the chapter is related to many topics regarding arrays and lists, suitable for developers with various levels of programming skills.

At the start of the chapter, the arrays will be presented and divided into single-dimensional, multi-dimensional, and jagged arrays. You will also get to know four sorting algorithms, namely selection, insertion, bubble sort, and quicksort. For each of them, you will see an illustration-based example, the implementation code, and a step-by-step explanation.

The arrays have a lot of possibilities...