Table of contents : C# Data Structures and Algorithms Contributors About the author About the reviewer Preface Who this book is for What this book covers To get the most out of this book Download the example code files Conventions used Get in touch Share Your Thoughts Download a free PDF copy of this book 1 Data Types C# as a programming language .NET-based console applications Division of data types Value types Integral numbers Floating-point numbers Boolean values Unicode characters Constants Enumerations Value tuples User-defined structs Nullable value types Reference types Objects Strings Classes Records Interfaces Delegates Dynamics Nullable reference types Summary 2 Introduction to Algorithms What are algorithms? Definition Real-world examples Notations for algorithm representation Natural language Flowchart Pseudocode Programming language Types of algorithms Recursive algorithms Divide and conquer algorithms Back-tracking algorithms Greedy algorithms Heuristic algorithms Dynamic programming Brute-force algorithms Computational complexity Time complexity Space complexity Summary 3 Arrays and Sorting Single-dimensional arrays Example – month names Multi-dimensional arrays Example – multiplication table Example – game map Jagged arrays Example – yearly transport plan Sorting algorithms Selection sort Insertion sort Bubble sort Merge sort Shell sort Quicksort Heap sort Performance analysis Summary 4 Variants of Lists Simple lists Array lists Generic lists Sorted lists Example – address book Linked lists Singly linked lists Doubly linked lists Circular singly linked lists Circular doubly linked lists List-related interfaces Summary 5 Stacks and Queues Stacks Example – reversing a word Example – Tower of Hanoi Queues Example – call center with a single consultant Example – call center with many consultants Priority queues Example – call center with priority support Circular queues Example – gravity roller coaster Summary 6 Dictionaries and Sets Hash tables Example – phone book Dictionaries Example – product location Example – user details Sorted dictionaries Example – encyclopedia Hash sets Example – coupons Example – swimming pools “Sorted” sets Example – removing duplicates Summary 7 Variants of Trees Basic trees Implementation Example – hierarchy of identifiers Example – company structure Binary trees Traversal Implementation Example – simple quiz Binary search trees Implementation Example – BST visualization Self-balancing trees AVL trees Red-black trees Tries Implementation Example – autocomplete Heaps Summary 8 Exploring Graphs The concept of graphs Applications Representations Adjacency list Adjacency matrix Implementation Node Edge Graph Example – undirected and unweighted edges Example – directed and weighted edges Traversal Depth-first search Breadth-first search Minimum spanning tree Kruskal’s algorithm Prim’s algorithm Example – telecommunication cable Coloring Example – voivodeship map Shortest path Example – path in game Summary 9 See in Action The Fibonacci series Minimum coin change Closest pair of points Fractal generation Rat in a maze A Sudoku puzzle Title guess A password guess Summary 10 Conclusion Classification Arrays Lists Stacks Queues Dictionaries Sets Trees Graphs The last word Index Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts Download a free PDF copy of this book