Image for post
Image for post
image courtesy: google.com

We have already seen how to create and work with variables, pointers, and Constants. In this article, we are going to see the four important collection types built into the language.

We start with humble Arrays, from there we move on to Slice, an evolved version of Array. From Slice, we talk about the map a key-value pair collection. Let’s start with Arrays here.

Array

Just like in any other programming language, an array in Go is a fixed-sized collection of similar data types.

Array declaration is very straightforward like any other language but with an interesting twist,

   other language syntax          |            Go syntax
int[] arr = new int[10] | arr :=…


Go data types
Go data types

Now its time for us to start digging into the Go language by talking in short about the primitive data types that are used. We are going to keep this discussion into three parts.

  1. Variable declaration and available primitive data types in Go
  2. Pointer and the features of pointers in Go
  3. Constants and how they are different from the other languages.

If you are from any other programming language, each one of these is going to be different from what you know. Let’s see them in detail and try to comprehend these features.

Variable declaration:

Unlike most of the languages, Go has various flavors of declaring variables. …


Image for post
Image for post

In the previous blog, we discussed arrays one of the most commonly known linear data structure in the programming world. Despite its simplicity and popularity Array by nature got few limitations,

  • Arrays are static by nature which makes it less flexible to fit when the amount of data grows or shrinks
  • Arrays are quite costly for common operations like insertion and deletion

In this blog, we are going to discuss another linear data structure called LinkedList which help to overcome a few limitations.

LinkedList:

LinkedList is a linear data structure where each element is an object. Unlike Array, LinkedList is doesn't have a contiguous memory structure. …

About

Madhavan Nagarajan

passionate, self-motivated developer with a good experience in IT and enjoy playing around web technologies. believe in going an extra mile…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store