Found 34494 Articles for Programming

Golang Program to Print a Matrix in Spiral Format

Akhil Sharma
Updated on 07-Sep-2023 16:52:06

189 Views

To Print a matrix in spiral format we need to traverse the matrix in a spiral pattern, starting from the outermost layer and gradually moving inward. This approach provides a visually appealing way to display matrix elements. In this article we will use two methods to print a matrix in spiral format, the first method is by using the iterative approach and the other one is using the recursive approach. The examples below will help you understand these methods. Explanation Let us assume we have a 3 x 3 matrix, to print a matrix in spiral format we need to ... Read More

Golang Program to Perform the Comb Sort Algorithm

Akhil Sharma
Updated on 07-Sep-2023 17:52:48

76 Views

Comb sort algorithm is a simple and efficient comparison−based sorting algorithm, Comb Sort improves upon Bubble Sort by eliminating small values towards the end of the array, resulting in faster sorting times. We can use two methods to implement Comb Sort algorithm in Gzolang, the first method is using a naive approach and the other one is using an optimized approach in which we enhance the efficiency of the algorithm by introducing a flag variable to track swaps. In this article, we will discuss the principle of comb sort algorithm and provide the syntax for the program. Explanation The Comb ... Read More

Golang Program to Implement Median of Medians

Akhil Sharma
Updated on 07-Sep-2023 16:49:04

208 Views

The median is the element in the middle of a dataset when the dataset is sorted. The Median of Medians algorithm is a powerful technique that is used to find out the median element in an unsorted array. In this article, we will implement median of medians algorithm in golanguage, using two methods like the recursive method and the iterative method. Explanation The Median of Medians algorithm, an efficient technique for determining the median value in an unsorted array. It introduces two distinct methods: the recursive approach and the iterative approach. Recursive Method: The findMedianRecursive function is introduced to ... Read More

Golang Program to Implement Rabin Karp

Akhil Sharma
Updated on 07-Sep-2023 16:47:10

98 Views

The Rabin−Karp algorithm in Golang is a powerful string searching algorithm used to efficiently locate a pattern within a larger text. In this article, we need to implement Rabin Karp algorithm in golanguage that will enable efficient pattern matching and showcasing the flexibility of this algorithm in Golang. We can use methods like the single function approach as well as using the modular approach. Pattern Matching Let us assume we have the text: “ABCABCDABCABC” and the pattern “ABC”, so by implement Rabin Karp algorithm in golanguage we can find out how many times and where this pattern repeat itself in ... Read More

GDevelop Alternatives

Shirjeel Yunus
Updated on 07-Sep-2023 15:56:36

84 Views

What is GDevelop? GDevelop is a game engine which users can use to develop games without having any development experience. No coding is required to develop the games. GDevelop can be used either on a browser or can be installed as a standalone app on the desktop. The platform has a lot of templates and you have to choose the one which can be used to develop your game. You can make 2D games on this platform. The drag-and-drop feature can be used to put the objects required in the game. Price Plans of GDevelop GDevelop has ... Read More

Handle Object Behavior in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:56:30

42 Views

MATLAB is an object-oriented programming (OOP) language that allows us to create objects and define their behavior. In MATLAB, there is a data type called 'Handle' which is used to point an object. Handles in MATLAB also allows us to pass a function as an input argument of some other function. In MATLAB programming, the handles are passed by reference instead of value. Therefore, when any change is made in the object's property, it will reflect across all the references. The use of handles in a MATLAB program makes it more memory efficient because it does not require copying ... Read More

Gray Level Co-occurrence Matrix in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:59:10

144 Views

In digital image processing, the gray level co-occurrence matrix, also known as GLCM, is a statistical method employed for holding the spatial relationship between pairs of pixels in a digital image. The gray level co-occurrence is a method of representing the way in which different combinations of pixel intensities are arranged within the image. It is mainly used to specify the texture property of an image and provide the information about the patterns, variations, and structures occurring in the pixel values within spatial regions of the image. What is Gray Level Co-Occurrence Matrix? As stated above, the gray level co-occurrence ... Read More

Gray Scale to Pseudo Color Transformation in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:49:45

182 Views

MATLAB provides an easy and efficient way of processing images. In this tutorial, we will explore how to perform gray scale to pseudo color transformation in MATLAB. In MATLAB, the gray scale to pseudo color transformation is an image processing technique which is used to create a visually appealing image by mapping the intensity values of the gray scale image to a specific color. If we want to convert a gray scale image to a pseudo color image using MATLAB, then we can use a built-in function in MATLAB, which is ‘colormap’ and a color map matrix. Now, let us ... Read More

Function with Variable Number of Input Arguments in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:45:59

131 Views

MATLAB is a high-level programming language that has capability to define a function that can accept a variable number of input arguments. In MATLAB, there is no need of defining any additional function or array to define a function with variable number of input arguments. How to Create a Function with Variable Number of Input Arguments in MATLAB? In MATLAB, when the keyword "varargin" is used in the function definition statement then it enables the function to take any number of input arguments. The "varargin" keyword is composed of "VARiable ARGument INput". It is important to note that the keyword ... Read More

Forward and Inverse Fourier Transform of an Image in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 13:43:38

364 Views

In mathematics, the Fourier transform is a mathematical tool used for converting a function or signal from the time domain to the frequency domain. It is widely used in the field of signal processing, communication, image processing and analysis, etc. Before proceed to find the forward and inverse Fourier transformer of an image using MATLAB, let us get a brief overview of Fourier transform and its inverse. Forward Fourier Transform Fourier transform or Forward Fourier transform is a mathematical operation that is used to transform a signal from the time domain into the frequency domain. Therefore, the forward Fourier transform ... Read More

Advertisements