C# Data Structures and Algorithms: Harness the power of C# to build a diverse range of efficient applications

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Building your own applications is exciting but challenging, especially when tackling complex problems tied to advanced data structures and algorithms. This endeavor demands profound knowledge of the programming language as well as data structures and algorithms - precisely what this book offers to C# developers. Starting with an introduction to algorithms, this book gradually immerses you in the world of arrays, lists, stacks, queues, dictionaries, and sets. Real-world examples, enriched with code snippets and illustrations, provide a practical understanding of these concepts. You'll also learn how to sort arrays using various algorithms, setting a solid foundation for your programming expertise. As you progress through the book, you'll venture into more complex data structures - trees and graphs - and discover algorithms for tasks such as determining the shortest path in a graph before advancing to see various algorithms in action, such as solving Sudoku. By the end of the book, you'll have learned how to use the C# language to build algorithmic components that are not only easy to understand and debug but also seamlessly applicable in various applications, spanning web and mobile platforms.

Author(s): Marcin Jamro
Edition: 2
Publisher: Packt Publishing
Year: 2024

Language: English
Pages: 465

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