Book Image

Everyday data structures

By : William Smith
Book Image

Everyday data structures

By: William Smith

Overview of this book

Explore a new world of data structures and their applications easily with this data structures book. Written by software expert William Smith, you?ll learn how to master basic and advanced data structure concepts. ? Fully understand data structures using Java, C and other common languages ? Work through practical examples and learn real-world applications ? Get to grips with data structure problem solving using case studies
Table of Contents (20 chapters)
Everyday Data Structures
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
1
Data Types: Foundational Structures

The essentials


Due to varying support from language to language, we're will take a different approach in this chapter. Instead of examining structs as a whole and then examining a case study, we will examine structs and case studies simultaneously for each language. This will give us the opportunity to examine the nuances of structs in each language within the proper context.

C#

In C#, a struct is defined as a value type that encapsulates small groups of related fields, which sounds very similar to the underlying C language implementation. However, C# structs are in fact quite different from those found in C, and they more closely resemble a regular class than a struct from that language. For instance, a C# struct can have methods, fields, properties, constants, indexers, operator methods, nested types, and events as well as defined constructors (but not default constructors, which are defined automatically). Structs can also implement one or more interfaces, all of which make the C# variety...