
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

270 Views
In this article, we will learn how to write a swift program to check if a given square matrix is the identity matrix. The identity matrix is an MxM square matrix in which the main diagonal consists of ones and other elements are all zero. For example − $\mathrm{M\:=\:\begin{bmatrix}1 & 0 & 0 & 0ewline0 & 1 & 0 & 0 ewline0 & 0 & 1 & 0 ewline0 & 0 & 0 & 1\end{bmatrix}}$ Whereas a square matrix is a matrix in which the number of rows is equal to number of columns and it may or may not ... Read More

474 Views
In this tutorial, we will write a go language program to remove duplicate elements from an array. By removing the duplicate entries, we mean that we wish to remove a value repeating multiple times. In this tutorial, we are using examples of an array of integers as well as an array of strings. Method 1: Remove Duplicate Values from an Array using an External Function The following code illustrates how we can remove duplicate values from an array of integers using a user-defined function. Algorithm Step 1 − First, we need to import the fmt package. Step 2 − ... Read More

2K+ Views
In this tutorial, we will see to write a go language program to calculate the average of numbers using arrays. We are creating two programs in this example. In the first method, we are using a user-defined function to calculate the average while in the second one we are using an internal go function to find the same. Method 1: Calculate the Average of Numbers using Arrays In this method, we will create a separate function and pass the array to it. The function accepts the array as an argument and then after calculating the average it returns the ... Read More

548 Views
In this tutorial, we will write a go language program to multiply two matrices by passing them to a function. In order to achieve this result, we will use both single dimension and multi-dimensional matrices. The difference between a single-dimension array and a multidimensional matrix is that the former has the same order while the latter has a different order of rows and columns. Method 1: Multiply Two Matrices of the Same Order by Passing them to a Function In this method, we will see to multiply two matrices of the same order bypassing the matrix to a user-defined function ... Read More

2K+ Views
In this tutorial, we will write a go language program to multiply two matrices. The difference between a single-dimensional array and a multi-dimensional array is that the former holds an attribute while the latter holds another array on the index. Additionally, every element of a multidimensional array will have the same data type. Method 1: Multiply Two Matrices using Multi-Dimensional Arrays in the Main Function In this method, we will write a golang program to multiply two Multi-dimensional matrices using for loops in the main() function. Algorithm Step 1 − Import the fmt package. Step 2 − Now, ... Read More

742 Views
Insertion sort is defined as an In-Place Algorithm and it is declared as a stable algorithm. The idea of sorting an array in ascending or descending order by swapping an element can be used to implement Insertion Sort. For instance, if the array contains only one item in the list, then it is considered sorted. Otherwise, we consider that a certain portion of the list of elements is sorted while other is unsorted. Proceeding with this assumption, we traverse through the unsorted list, picking one element at a time. Syntax rand.Seed(value) Rand.Seed() function is used to generate random ... Read More

912 Views
In this tutorial, we will write a go language program to iterate over each element of the array. An array is a data structure that is used to store data at contiguous memory locations. There are many methods to iterate over an array. The simplest one is to use a for loop. Here, we will see how we can iterate over the integer and string types of arrays using various methods in go. Method 1: Iterate over the Array using For Loop In this method, we will write a go language program to iterate over the array using for loops. ... Read More

969 Views
In this article, we will write a go language program to find the transpose of a matrix. A matrix is a collection of numbers arranged in rows and columns, a two-dimensional array. Transpose of a matrix is defined as a matrix obtained by interchanging the rows and columns of that matrix. Method 1: Find the Transpose of a Matrix using For Loop In this example, we will write a go language program to find the transpose of the matrix using for loops in the main function. Algorithm Step 1 − Import the fmt package. Step 2 − Call the main() ... Read More

318 Views
In this article, we will write a go language program to print the upper triangular matrix of any given matrix. Introduction − A square matrix is called an upper triangular matrix if it has zero values below the principal diagonal. A matrix is displayed in its upper triangular form only if it is square. i.e. it must have the same number of rows and columns. The order of a typical upper triangular matrix is N X N. Method 1: Display Upper Triangular Matrix using For Loops In this method, we will write a go language program to display upper ... Read More

5K+ Views
In this article, we will write a go language program to remove duplicates from an array. To achieve this we will be using two approaches. In the first one, we will use the array of strings, and in the second one; we will be using an array of integers. Method 1: Remove Duplicates from an Array of Strings using The Make() Function In this example, we will write a go language program to remove duplicates from the array of strings using a user-defined function. The function will accept the array of strings as an argument and will return the final ... Read More