Found 26504 Articles for Server Side Programming

How to find the GCD of Two given numbers using Recursion in Golang?

Aman Sharma
Updated on 11-Jan-2023 17:16:17

346 Views

In this tutorial, we will see how to find the Greatest common divisor of two numbers using the Golang language using recursion. We will see two ways to find the GCD of two numbers recursively. First will take more time where we are reducing the minimum of both numbers by 1 and then check if both the numbers are divisible by the min number or not. The second approach will take less time where we are subtracting the larger number from the smaller number until both numbers become equal. Algorithm Step 1 - Declaring the variables to store the ... Read More

How to return multiple values from the function in Golang?

Aman Sharma
Updated on 11-Jan-2023 17:13:58

2K+ Views

In this tutorial, we are going to see how we can return multiple values from the function in Golang with the help of an algorithm and examples. Like other programming languages like python, Golang also supports returning multiple values from a function. In the first, example we are going to pass two numbers in the function and return the smaller and then greater number together. In the second example we are passing two numbers and returning the addition, subtraction, multiplication, and division at once. Syntax Func functionName(arguments) (returnType1, returnType2, …) { // logic ... Read More

How to find the Reverse of a given number using Recursion in Golang?

Aman Sharma
Updated on 11-Jan-2023 17:10:40

727 Views

In this tutorial, we are going to learn how we can find the reverse of the given number in the Golang programming language. The recursive function is more suitable if we want to modify the function that is not possible with a For loop. In this article, we are going to achieve this by using recursion. Explanation Iteration 1: Number = 54678 Reverse of number = 0 Reverse of number = Reverse of number * 10 + Number % 10 = 0 + 54678 % 10 = 0 + 8 = ... Read More

How to find the LCM of two given numbers using Recursion in Golang?

Aman Sharma
Updated on 11-Jan-2023 17:02:33

745 Views

In this tutorial, we are going to find the Least common multiple of two numbers in Golang using recursion. To find the LCM recursively we are going to use the relation of LCM with the Greatest common divisible i.e GCD of both the numbers. LCM stands for least common multiple is the smallest number divisible by two numbers. For example, Suppose the two numbers are 10 and 4. The smallest number that is divisible by both numbers evenly is 20. Finding LCM Using the Relation between LCM and GCD In this example, we are going to find the LCM using ... Read More

How to check whether a character is in the Alphabet or not in Golang?

Aman Sharma
Updated on 11-Jan-2023 16:54:04

1K+ Views

In this tutorial, we will learn how to check whether the character is an alphabet or not. This tutorial includes two ways to achieve this − First, using the built-in function isLetter() present in the fmt library will reduce the line of codes. Another way is to use the concept of ASCII values as every character has a unique ASCII value using which we can find out whether the current character is an alphabet or not. The ranges of uppercase and lowercase alphabets are as follows − uppercase alphabets – 65 to 90 lowercase alphabets – 97 to 122 If ... Read More

Command Line Automation in Python

Prabhdeep Singh
Updated on 11-Jan-2023 18:20:31

6K+ Views

Python comes with a command line for managing user input and specific forms of data entering while Python applications are being executed. As a result, users can enter data and complete tasks otherwise that would be impossible. This also enables more complex tasks and increased program interaction. To communicate with computers and execute programs, one uses a command-line interface (CLI), and a text-based user interface (UI). Additional names for command-line interfaces include character user interfaces, console user interfaces, and command-line user interfaces. In this article, you will learn what the Python command-line interface (CLI) is and how to automate the ... Read More

Writing Efficient Python Code

Prabhdeep Singh
Updated on 11-Jan-2023 18:18:57

535 Views

In this article, we are going to discuss how to write efficient code in python and also discuss their importance. Python is a robust programming language that allows you to accomplish a lot with a minimal amount of code. You must prevent the use of code that is not necessary and employ suitable procedures and strategies to make your code run more quickly if you want to produce effective and optimized code. This article will go over several methods for writing Python code more quickly and effectively. Like − Establishing a function. Reduce unnecessary operations. Do not declare ... Read More

How to easily manage your software using conda?

Prabhdeep Singh
Updated on 11-Jan-2023 11:25:03

301 Views

Conda is an environment and package manager which is the best and the easiest of all the competitors available in the market. The main need of the conda is to manage the software as there could be a triangle of the software where the first software will depend upon a specific version of the second software while a third software depends upon another specific version of the second software. For these types of situations, conda provides a different environment where both versions of the software can exist without impacting the another. Introduction to Software Software is a set of instructions, ... Read More

B*-Trees implementation in C++

Raunak Jain
Updated on 16-Jan-2023 16:03:38

2K+ Views

B*-Trees: An Optimized Data Structure for Fast Data Retrieval in C++ A B*-tree is a self-balancing tree data structure that is optimized for fast data retrieval. It is a variant of the B-tree, which is a tree data structure that is designed to keep its data sorted and balanced. A B-tree is characterized by the fact that it has a high degree of order, meaning that its nodes are kept sorted in a specific manner. A B*-tree is similar to a B-tree, but it is optimized for even better performance. This is achieved through the use of a number of ... Read More

Attributes to Relationships in ER Model

Raunak Jain
Updated on 16-Jan-2023 16:05:35

5K+ Views

Introduction In database design, the Entity Relationship (ER) model is a powerful tool for representing the structure of a database. One important aspect of the ER model is the way it handles attributes and relationships between entities. In this article, we will explore the concepts of attributes and relationships in the ER model, and how they are used to represent the data in a database. We will also provide real-life examples, code examples, and diagrams to illustrate these concepts. Attributes in the ER Model In the ER model, an attribute is a characteristic or property of an entity that describes ... Read More

Advertisements