Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 1639 of 2109
Swift Program to Check if two sets are equal
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 MoreSwift Program to Check if a Set is empty
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 MoreSwift Program to Convert an Set of String to Comma Separated String
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 MoreMaximize value of coins from adjacent row and columns cannot to be collected
Dynamic programming is an optimization algorithmic technique to solve the particular problems by splitting them into some simple sub problems. It is a procedure by which we can combine the quality, condition, or fact of a complete search for a greedy algorithm being exact and accurate. But this method is an oxymoron itself because it comes with a great advantage and that is also its biggest disadvantage and limitation too. We can divide a problem into some sub problem but we can't divide the sub problems again. They should be solvable by its own. The concept of the sub problems ...
Read MoreReverse each word in a linked list Node
A linked list is a chain alike linear data structure, where the elements are not saved at memory in an adjacent manner, unlike array. In a particular linked list, the elements are linked with the next element by a pointer. In simple words; a linked list is a series of some data containers where we can find a path way or a reference link in those elements to the next node. There is a head pointer present as the first element in a linked list. If the first node of that particular list is empty then it points nothing or ...
Read MoreMinimum Changes to string to make all substrings distinct
A string is a particular object, which represents a sequence and flow of data characters. The strings are the data container which always represented as a text format. It also used to concept, compare, split, join, replace, trim, length, intern, equals, comparison, substring operation. A substring() is a data refining process, which extracts the saved data of between two positions from start to end. A substring () does not change the original string. In a data set when we have different characters, they can be denoted as distinct data elements. For example: 'a' and 'r' are distinct while 'r' ...
Read MoreFunction to copy string (Iterative and Recursive)
In a C++ environment, iteration statement is a compound or cause statement which can be executed zero or more than one at a time. This process is subjected to a loop termination process. The statement executes in a particular order when there is a presence of break statement or the continuation of a statement. There are four types of iteration present in C++ - While Do For Range-based for Every loops mentioned here iterates a particular condition until its termination. The expression evaluates as zero when the statement. The iteration statements can't be considered as declaration. In ...
Read MoreTransform a string such that it has abcd..z as a subsequence
Transforming a string aka string transformation is an operation in C++ by which the result stores in an output array after the execution of the whole process. In C++ there is a function called "transform()", present in the directory of the C++ environment by which we can transform a string into a new one. There are two forms of this transform function − Unary operation Operation applies on the every element of the input array. After the operation being done the result will store in an output array. Binary operation Operation applies on each element ...
Read MoreStrong Password Suggester Program
Every year on 7th May the worldwide organizations remind there users about the significance of a strong password. As per the tech giant Google; 24% of their end users have used the word "password" or "Qwerty" as their account password. While, only 34% from their total users change their account passwords in a frequent manner. In this tech-forward world today, every login attempt has a chance of a cyber criminal attack. But many people now a days still using the weak passwords for their professional and personal accounts. Here we will discuss and check, whether the created passwords ...
Read MoreGolang program to implement dijikstra Algorithm to find shortest path between two nodes in a graph
In this Golang article, we will explore how to implement Dijkstra's Algorithm to find the shortest path between two nodes in a graph using an Adjacency Matrix as well as using an Adjacency List. Dijkstra's Algorithm is used to solve the single-source shortest path problem in a graph with non-negative edge weights. Algorithm Step 1 − First, we need to import the fmt and math packages. Then create a dist array of length n (the number of nodes in the graph) and initialize it with math.MaxInt32. This array will store the shortest distance from the starting node to every ...
Read More