
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 33676 Articles for Programming

218 Views
In golang, circular linked lists are an important data structure used in computer science to efficiently manage memory and data. A circular linked list is a linked list in which the last node of the list points to the first node of the list, creating a loop. Using Traversal Method In this method, we will write a go language program to count the number of nodes in a circular linked list by traversing through it. Algorithm Step 1 − First, we need to import the fmt package. Step 2 − Now, initialize a node struct and assign two ... Read More

3K+ Views
In Swift, we can find the second largest element from the given array using the sort() function or using user defined function. For example, we have the following array − Array = [34, 23, 1, 45, 3] Hence the largest element is 45 and the second largest element is 34. So lets discuss both the methods in detail along with examples. Method 1 In this method, we find the second largest element from the specified array by creating user defined function. Example In the following example, we will create a function named as ‘secondlargestElement’, it takes an array as ... Read More

1K+ Views
In Swift, a set is used to define an unordered collection of unique elements whereas an array is used to define an ordered collection with may or may not be unique elements. To convert a set into an array Swift provides an inbuilt initializer named as Array(). Syntax Array(MySet) Where Array() initializer takes only one parameter that is the name of the set and, returns an array of the same type. Example In the following example, we will create and initialize a set of strings. Then convert the set into the array using Array() initializer and then display the ... Read More

2K+ Views
Swift provide a inbuilt method named as joined() to convert a set of string to comma separated string. This function return the concatenated elements of the given sequence by inserting the given separator in between each element of the sequence. Syntax func joined(separator: sep) Where the separator parameter contains a string or sequence, which is further used to insert between each element of the given sequence. This function returns a concatenated or joined sequence of elements. Example In the following code, we will create and initialize a set of strings. Then we join the elements of the set ... Read More

300 Views
Swift provide an equality operator(==) to check if the given two sets are equal or not. Here the equality of two the sets means that both the sets should be identical in terms of their size and elements. So if both the sets are identical or the same, then the equality operator returns true. Otherwise, the equality operator will return false. Syntax set1 == set2 Where set1 and set2 are two sets and using the == operator we check if they are equal or not. This operator will return true if both sets are equal. Else it will return ... Read More

493 Views
In Swift, a set is used to create a collection of unique elements. In a set, the elements are not arranged in a particular order. Now to check if a set is empty or not Swift provide an inbuilt property named as isEmpty. This property will return true if the given set is empty. Otherwise it will return false. Syntax newSet.isEmpty Where newSet is the name of the set and we can access the isEmpty property using the dot operator. This property's return type is bool, meaning if it returns true, it means the set is empty. If it ... Read More

238 Views
In swift, a complex number is the combination of real and imaginary number. So we create a class to store the real and imaginary part of the complex number and then we pass this class in the function to find the sum of two complex numbers. Algorithm Step 1 − Create a class to store the real and imaginary part of the complex number. Step 2 − Create a function named as ‘add’ which takes two class objects as a parameters and return the sum of the two complex numbers by adding the real and imaginary part ... Read More

724 Views
In Swift, set is used to create an unordered collection of unique elements. Swift provide inbuilt functions named as formUnion() and insert() function to insert elements to a set. Lets discuss both the methods in detail along with examples. Method 1: Using formUnion(_:) function The formUnion(_:) function is used to insert elements of the given collection into the set. Syntax func formUnion(newSequence) Where newSequence represents a collection of elements, it can be either an array or set. Also the newSequence collection must a finite collection. This function does not return any value it only add new element into the ... Read More

4K+ Views
Introduction Process synchronization is a critical concept in computer science, especially in operating systems. It involves coordinating the activities of multiple processes to ensure that they run correctly and avoid conflicts. Mutual exclusion is a fundamental problem in process synchronization that arises when multiple processes need to access a shared resource or critical section. If two or more processes simultaneously access the same shared resource, it can lead to incorrect results or data corruption. To solve this problem, various algorithms have been developed over the years. One of the most popular of these is Dekker's algorithm, which was proposed by ... Read More

2K+ Views
In this article, we will write Golang programs to print pointer to a struct. A pointer stores the address of the memory location where the variable’s value is placed. We can the access the address of the variable using & operator. For ex= &a tell the address of the a. Example 1 In this example, we will write a Golang program to show the pointer to a struct by creating a child struct and printing the pointer to that struct. package main import "fmt" type Child struct { name string age ... Read More