filmov
tv
Learn to Use Basic Data Structures - Slices, Structs and Maps in Golang

Показать описание
This programming tutorial is a practical introduction to data structures. You will learn how to use slices, structs and maps to organize your data in Golang. Every concept is applied to our sample project that reads text from a file in order to count word occurrences. Finally, we talk about suitability of certain data structures for specific tasks.
Links:
Timestamps:
00:00:00 Content overview
00:07:53 Project setup and hello world
00:12:25 Opening a file and checking for errors (intro to blank identifier)
00:20:41 Reading text from a file (split into words)
00:31:52 Concept of slices (lists)
00:41:36 Basic usage of slices (make, append, len, indexed access)
00:55:31 Cutting slices from slices (manual implementation vs slicing operations)
01:09:24 Shorthand for slice initialization
01:13:28 Reading user input from the terminal
01:23:02 Searching element in a slice (counting word occurrences)
01:25:20 Simple string functions for input cleanup
01:44:12 Brief look at regular expressions for input cleanup
01:59:02 Basic usage of structs
02:18:27 Why searching of elements can be inefficient
02:21:19 Range function returns copied elements (use index for writes)
02:24:22 Sorting elements (how to assign and pass functions)
02:46:07 Loop over elements with early exit (break, range, blank identifier)
02:49:15 Concept of maps
02:55:32 Using a map for simple lookups (avoid searching)
03:02:41 Using a map for counting occurrences efficiently
03:11:18 Measuring durations (performance comparison)
03:26:14 Closing files (defer)
03:30:39 Quick recap and next steps
Links:
Timestamps:
00:00:00 Content overview
00:07:53 Project setup and hello world
00:12:25 Opening a file and checking for errors (intro to blank identifier)
00:20:41 Reading text from a file (split into words)
00:31:52 Concept of slices (lists)
00:41:36 Basic usage of slices (make, append, len, indexed access)
00:55:31 Cutting slices from slices (manual implementation vs slicing operations)
01:09:24 Shorthand for slice initialization
01:13:28 Reading user input from the terminal
01:23:02 Searching element in a slice (counting word occurrences)
01:25:20 Simple string functions for input cleanup
01:44:12 Brief look at regular expressions for input cleanup
01:59:02 Basic usage of structs
02:18:27 Why searching of elements can be inefficient
02:21:19 Range function returns copied elements (use index for writes)
02:24:22 Sorting elements (how to assign and pass functions)
02:46:07 Loop over elements with early exit (break, range, blank identifier)
02:49:15 Concept of maps
02:55:32 Using a map for simple lookups (avoid searching)
03:02:41 Using a map for counting occurrences efficiently
03:11:18 Measuring durations (performance comparison)
03:26:14 Closing files (defer)
03:30:39 Quick recap and next steps