Same Tree in Java | Tree Problem

4 years ago Lalit Bhagtani 0
Problem Statement You have given two binary trees, find out if both trees are same or not. Two binary trees are same, if they are structurally identical and the nodes have same value. Example  1)  Above two binary trees are structurally same and their node values are also same. 2)  Above two binary trees are Read More

Sum of all Left Leaves in Java | Tree Problem

4 years ago Lalit Bhagtani 0
Problem Statement You have given a binary tree, find out the sum of all left leaves value. Example  There are two left leaves in above binary tree, 9 and 15, So result should be 24. Algorithm  We can use Depth First Traversal algorithm to solve this problem. Program  Result 24 Similar Post Sum of all Read More

How to compare two Strings in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to compare two strings in Go programming language. Comparison Operators The comparison operators like ==, != can be use to compare two strings. Operators works in the following way :- == :- It returns true, if both strings are equal otherwise it returns false. !=  :- It returns Read More

How to convert Float to String type in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert float to string type in Go programming language. FormatFloat The function FormatFloat converts the floating point number to a string value according to the format and precision passed as an argument. It rounds the result value, by assuming that the original value was obtained from a floating Read More

How to convert Int to String type in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert int to string type in Go programming language. FormatInt The function FormatInt converts the integer type value in the given base (2 to 36) to a string type. It uses the lower case letters ‘a’ to ‘z’ for digit values greater than 10, like in case of Read More

How to convert Boolean to String type in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert boolean to string type in Go programming language. FormatBool The function FormatBool converts the boolean value passed as an argument to a string type. Syntax func FormatBool(b bool) string Example package main import ( "fmt" "strconv" ) func main() { var ( booleanT = true booleanF = false Read More

How to convert String to Boolean type in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert string to boolean type in Go programming language. ParseBool The function ParseBool converts the string to a boolean value. It can accepts 1, t, T, TRUE, true, True for true boolean value and 0, f, F, FALSE, false, False for false boolean value. Any other value will return Read More

How to convert String to Int type in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert string to int type in Go programming language. ParseInt The function ParseInt converts the string in the given base (0, 2 to 36) to a integer number with the precision specified by bitSize value passed as an argument. The bitSize value can be of four type, 0 Read More

How to convert String to Float type in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to convert string to float type in Go programming language. ParseFloat The function ParseFloat converts the string to a floating point number with the precision specified by bitSize value passed as an argument. The bitSize value can be of two type, 32 for float32 data type and 64 for Read More

How to get Type of declared variable in GoLang | GoLang Tutorial

4 years ago Lalit Bhagtani 0
In this tutorial, we will learn about how to get the Type of a variable in Go programming language. GoLang TypeOf The GoLang reflect package has a function for getting the type of a declared variable. The function TypeOf returns a Type, which can be converted to a string by calling String function. Syntax func TypeOf(i interface{}) Type Read More