Create a Simple Map in Go

Akhil Sharma
Updated on 07-Sep-2023 17:08:37

257 Views

Maps in Go are powerful data structures that allow us to store and retrieve key−value pairs. They are useful for various applications, such as storing and manipulating data, implementing dictionaries, and performing efficient lookups. In this article, we will write a program to create a simple map in golanguage using two methods that include the literal method and the make() function method. Algorithm Declare a map variable using the desired key and value types. Initialise the map using the literal notation by enclosing key−value pairs in curly braces {}. Assign values to the respective keys using the colon ':' ... Read More

Create HTTPS Server with Node.js

Aayush Mohan Sinha
Updated on 07-Sep-2023 17:08:35

1K+ Views

As the consumption of the cyberspace and cloud-dependent applications proliferates, the gravity of safeguarding online data and transactions becomes more apparent. One of the most commonly employed methodologies for securing online communications is HTTPS, which provides an assurance that the information conveyed between the server and clients is ciphered and cannot be effortlessly intercepted by malevolent third parties. In this manuscript, we will probe into the process of building an HTTPS server with Node.js, an influential and adaptable platform for developing server-side applications using JavaScript. We will go over the fundamentals of SSL certificates, the essential components of an HTTPS ... Read More

Perform Slices Permutations of Numbers in Go

Akhil Sharma
Updated on 07-Sep-2023 17:05:12

555 Views

A slice is a portion of data extracted from an array, list or a data structure. Permutations refer to the rearrangement of elements in a specific order.Here slice permutation means to generate all the possible permutations of the number entered by user. In this article, we will explore how to perform slices permutations of numbers entered by user in Golang, using two methods the recursive approach and the iterative approach, to generate all possible permutations of the given slice. Explanation Recursive: Our first trick is the generatePermutationsRecursive() function. It starts simple, handling small batches of numbers like a warm−up. ... Read More

Print All Permutations of a Given String in Go

Akhil Sharma
Updated on 07-Sep-2023 16:54:50

2K+ Views

A permutation is an arrangement of the characters of a string in a specific order. In some cases we need to print all the permutations of a string to create anagram games or puzzle games where users need to find out the letters hidden in the string. In this article we are going to print all permutations of a string in golanguage using two different approaches that include the recursive and the iterative approach. These methods allow us to generate all possible permutations of a given string, enabling various applications such as generating anagrams, solving permutation−based problems, and more. Explanation ... Read More

Print a Matrix in Spiral Format in Golang

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

468 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

Change the Style of a Tag Title Attribute

Aayush Mohan Sinha
Updated on 07-Sep-2023 16:49:37

6K+ Views

The title attribute of the tag is a significant facet of web design that furnishes supplementary information about a link when a user hovers over it. Nonetheless, the pre-existing style of the title attribute may not always comply with the visual appeal of a website, compelling designers to investigate ways to personalize it. In this write-up, we will examine various tactics and approaches accessible to adjust the style of the tag title attribute. By the conclusion of this article, you will have a more comprehensive comprehension of how to implement this uncomplicated yet potent modification to enhance the ... Read More

Implement Median of Medians in Golang

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

504 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

240 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

Add ButtonGroup in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 15:28:01

189 Views

In MATLAB, we can create different types of graphical user interface (GUI) components like Edit Fields, Hyperlinks, Buttons, and more. In this tutorial, we shall confine our attention to add a ButtonGroup in MATLAB. What is a ButtonGroup in MATLAB? MATLAB is an environment that provides an easy way of creating GUI applications without proper knowledge of computer programming. In MATLAB, there is a graphical user interface (GUI) component namely, ButtonGroup, which allows us to create a group of radio buttons or option buttons. One can select only one radio button within the group at a time. This GUI component ... Read More

Finding Inverse of a Square Matrix Using Cayley-Hamilton Theorem in MATLAB

Manish Kumar Saini
Updated on 07-Sep-2023 15:25:55

384 Views

Let us start this tutorial with a brief discussion on "what is inverse of a square matrix" and "the significance of Cayley Hamilton theorem". What is Inverse of Square Matrix? In linear algebra, there is a fundamental concept called the inverse of a square matrix. Consider a square matrix ‘A’, then there will another square matrix ‘A-1’ such as A.A-1 = I, where I is an identity matrix. Here, A-1 is called the inverse of the square matrix A. It is an important point to note that for a given square matrix the inverse can be found if and only ... Read More

Advertisements