From the course: Advanced Go Programming: Data Structures, Code Architecture, and Testing

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Common data structures

Common data structures

- [Instructor] Data structures offer us efficient ways to store and access data. Let's dive right in by exploring the behavior of five of the most common data structures. Understanding how these structures behave is an important part of leveling up your programming skills. The simplest data structures are arrays and slices. We'll be using these built-in types often. Arrays are fixed size, contiguous blocks of memory that contain a single data type. Elements are accessed by index, starting with zero. Once the array is full, you need to create a new array and copy the elements to the new array in order to extend it. Slices are dynamic, flexible views of arrays. They are specified by passing a start and stop index to an existing array. Just like arrays, elements are accessed by index but resizing is done automatically when elements are added. we'll have a closer look at the intricacies of slices and arrays a little later.…

Contents