Akhil Sharma has Published 671 Articles

Golang program to check if a set is the subset of another slice

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:08:32

1K+ Views

Slice is similar to the array, the only difference is that an array is a fixed sequence of elements whereas slice the array elements are dynamic. This makes slice more efficient and faster in various applications. In slice the elements are passed by reference instead of values. In this article, ... Read More

Golang program to convert slice into array

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:07:08

3K+ Views

A slice can also be called as a dynamic array as its value is dynamic whereas a normal array is static. This makes the slice more efficient and faster. They are passed by reference instead of value. Here we are going to learn different techniques of converting a slice into ... Read More

Golang program to make string immutable

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:06:07

202 Views

Strings are by default immutable in Go. A string cannot be changed once it has been created. A compile-time error will appear if the value of a string is attempted to be changed. Therefore, there is no need to add any more logic to make it immutable. Let’s see how ... Read More

Golang program to convert array into slice

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:04:40

3K+ Views

A slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas slice is a dynamic array which means its value is not fixed and can be changed. Slices are more efficient and faster than arrays moreover they are passed by reference ... Read More

Golang program to calculate difference between two slices

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:03:23

3K+ Views

A slice can also be called as dynamic array as it's value is dynamic whereas normal array is static. This makes slice more efficient and faster. They are passed by reference instead by value. Here we are going to learn about how can we find the difference between two slices ... Read More

Golang Program to Calculate the intersection of two Slices

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:01:20

1K+ Views

In Golang, a slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas slice is a dynamic array which means its value is not fixed and can be changed. Slices are more efficient and faster than arrays moreover they are passed ... Read More

Golang program to calculate union of two slices

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:59:54

1K+ Views

In golang, a slice is known as dynamic array where it's value is not fixed and can be changed. It is more efficient and faster compared to simple arrays. In this article, we are going to learn how to calculate a union of two different slices using examples. Syntax func ... Read More

Golang program to split a slice into two halves

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:58:37

2K+ Views

A slice can also be called as a dynamic array as it's value is dynamic whereas normal array is static. This makes slice more efficient and faster. They are passed by reference instead by value. Let us learn how to split a slice into two halves using Golang program. Syntax ... Read More

Golang program to merge two slices

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:57:29

4K+ Views

In Golang, a slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas slice is a dynamic array which means its value is not fixed and can be changed. Slices are more efficient and faster than arrays moreover they are passed ... Read More

Golang program to replace a character at a specific index

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 15:46:44

1K+ Views

In this tutorial, we will inculcate how to replace a character at a specific index using few examples. The output will be printed on the console using fmt.Println() function. Let’s dive deep into the examples and see how it’s done. Method 1: Using Replace Function In this method, we will ... Read More

Advertisements