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)

Summary


In this chapter, you have learned about three limited access data structures, namely stacks, queues, and priority queues. It is worth remembering that such data structures have strictly specified ways of accessing elements. All of them also have various real-world applications, and some have been mentioned and described in this book.

First, you saw how the stack operates according to the LIFO principle. In this case, you can only add an element at the top of the stack (the push operation), and only remove an element from the top (the pop operation). The stack has been shown in two examples, namely for reversing a word and for solving the Tower of Hanoi mathematical game.

In the following part of the chapter, you got to know the queue as a data structure, which operates according to the FIFO principle. In this case, enqueue and dequeue operations were presented. The queue has been explained using two examples, both regarding the application simulating a call center. Furthermore, you...