Akhil Sharma has Published 671 Articles

Golang program to find all paths in a graph

Akhil Sharma

Akhil Sharma

Updated on 05-Apr-2023 15:14:55

491 Views

In this article we are going to learn how to use DFS Algorithm and breath-first searh method in golang to find all the paths in the a graph. In a graph, the nodes are depicted by the entities while the edges depict the relation between those entities. Finding all paths ... Read More

Golang program to count number of nodes in a circular linked list

Akhil Sharma

Akhil Sharma

Updated on 05-Apr-2023 15:10:16

134 Views

In golang, circular linked lists are an important data structure used in computer science to efficiently manage memory and data. A circular linked list is a linked list in which the last node of the list points to the first node of the list, creating a loop. Using Traversal Method ... Read More

Golang program to convert the local time to GMT

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 16:09:35

1K+ Views

In this article, we will learn to write a Go language program to convert the local time to GMT using internal functions like Now() Time, LoadLocation()and time.In(). Local time is the time of a particular region which is calculated using position of the sun at noon. The local time is ... Read More

Golang Program to Check Whether an Alphabet is Vowel or Consonant

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 14:05:50

639 Views

In this tutorial we will write a go language code to check whether an alphabet is vowel or consonant. Difference between Vowel and Consonant A character is called vowel if it is in any one of the following list of characters {a, e, I, o, u}. All the remaining characters ... Read More

Golang program to print pointer to a struct

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 12:10:14

2K+ Views

In this article, we will write Golang programs to print pointer to a struct. A pointer stores the address of the memory location where the variable’s value is placed. We can the access the address of the variable using & operator. For ex= &a tell the address of the a. ... Read More

Golang program to demonstrate passing of pointers to a function

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 12:09:16

174 Views

In this Golang article, we will write programs to demonstrate passing of pointers to a function suing increment and Swapping approach. A pointer stores the address of another variable. For ex- var *a = &b. Here a is the pointer that stores the address of b which means a can ... Read More

Golang program to implement returning pointer from a function

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 12:08:17

529 Views

In this article, we will write Golang programs to implement returning pointer from a function. A pointer stores the address of another variable and the address is depicted using & operator. Algorithm Step 1 − Create a package main and declare fmt(format package) package in the program where main ... Read More

Golang program to parse time

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 12:07:54

1K+ Views

In golang we can use various internal time function to parse time. Time is parsed using parse and ParseInLocation method. Syntax time.Parse() This function belongs to time package. It is used to parse the string into time.Time value and it takes two inputs: the layout and the time string ... Read More

Golang program to implement select statement

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 12:07:17

240 Views

The Golang Select statement is similar to the switch statement, the switch statement selects the Output based on the cases but here the Output is selected based on which communication occurs fast in the channels. Syntax func make ([] type, size, capacity) The make function in go language is ... Read More

Golang program to show promoted methods

Akhil Sharma

Akhil Sharma

Updated on 04-Apr-2023 12:06:19

311 Views

In golang, Promoted methods are the methods created under those structs which are embedded inside another struct, now the struct in which it is embedded can access its methods and fields. In this article we are going to explain how to show promoted methods using various structs like Rectangle and ... Read More

Advertisements