Articles on Trending Technologies

Technical articles with clear explanations and examples

C++ Program to Check the Connectivity of Undirected Graph Using BFS

Vrundesha Joshi
Vrundesha Joshi
Updated on 15-Apr-2025 2K+ Views

The Breadth-First Search (BFS) algorithm is a graph traversal algorithm that starts at the tree root and explores all nodes at the present depth before moving to the nodes at the next level. In this article, we will discuss how to check the connectivity of a graph using BFS traversal algorithm. Understanding Connectivity of a Graph A graph is said to be connected if there is a path between every pair of vertices. To check connectivity of a graph, we will try to traverse all nodes using any traversal algorithm. After completing the traversal, if there is any ...

Read More

What is the importance of a Cursor class in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 14-Apr-2025 3K+ Views

In this article, we will learn about the importance of the Cursor class in Java. Under the Swing toolkit, the Cursor class provides an improved user experience by providing graphical(visual) feedback. What is a Cursor class? A Cursor is a subclass of the Object class, and it can be defined as point or indicator on the screen. A Cursor is used to select the input from the system that the user operates with the mouse. The important methods of Cursor class are getDefaultCursor(), getName(), getPredefinedCursor(), getSystemCustomCursor(), and getType(). Syntax The following is the syntax: Cursor cursor = new Cursor(Type_of_Cursor); Different ...

Read More

What should main() return in C and C++?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 14-Apr-2025 4K+ Views

In C/C++, the main() function is used in the beginning of every program. This returns the program execution status in the operating system. Syntax Following is the syntax of the main() function using C/C++: int main(void); int main(int argc, char *argv[]); Example Below, the C/C++ example shows the usage of the main() return value. C C++ #include int main() { printf("Hello, C World!"); return 0; } Key Points of C Return 0: This is standard for successful execution Non-zero: It indicates error Implicit return: C99 allows omitting return #include int main() { std::cout

Read More

Check if all the 1s in a binary string are equidistant or not in C++

C++
AYUSH MISHRA
AYUSH MISHRA
Updated on 14-Apr-2025 241 Views

In this problem, we are given a binary string, and we have to check if all the 1s present in the binary string are at an equivalent distance from each other. Example 1 Input: binaryString = "10101010" Output: Yes Explanation The positions of 1s in the given string are 1, 3, 5, and 7.Here, the difference between consecutive 1s is 2 (as 7-5 equals 5-3 equals 3-1), so all 1s are at an equivalent distance from each other. Example 2 Input: binaryString = ...

Read More

Difference between Tree Set and Hash Set in Java

Alshifa Hasnain
Alshifa Hasnain
Updated on 14-Apr-2025 20K+ Views

In Java,  HashSet and TreeSet both belong to the collection framework. HashSet is the implementation of the Set interface, whereas TreeSet implements a sorted set. TreeSet is backed by TreeMap while HashSet is backed by a HashMap. Difference Table The following are the key differences between HashSet and TreeSet : Sr. No. Key ...

Read More

Create Multiple Sub-folders in Google Drive Automatically

Ayodhay Kushwaha
Ayodhay Kushwaha
Updated on 14-Apr-2025 163 Views

Automatically creating multiple sub-folders in Google drive helps organize files efficiently and saves time. Instead of manually setting up folders, using App Script for automatic sub-folders ensures efficient document management. This is important for educators and individuals handling large datasets, as it improves accessibility, collaboration and systematic file management. Step by step procedure for creating multiple sub-folders in google drive automatically is given below as:- Step 1: Open Google Drive and create a parent folder Go to https://drive.google.com/drive.Click New. And then, select New Folder. Name the folder (e.g.,  Main Folder) and click the Create button. Open the Folder and copy ...

Read More

How blockchain is revolutionizing payments and transactions in fintech?

Harleen Kaur
Harleen Kaur
Updated on 14-Apr-2025 524 Views

Blockchain technology opens up a world of opportunities for the financial sector. Fintech businesses may use blockchain to lower costs, automate processes, expand their reach, and increase data transparency. This article examines how financial services is changing for both individuals and corporations as a result of the convergence of fintech and blockchain.What is the place of blockchain in fintech?A decentralized peer-to-peer (P2P) ledger known as blockchain keeps track of transactions on an open, tamper-proof computer network. The technology has been in use for more than ten years, and at least six of those years have been spent in the finance ...

Read More

How to pass multiple props in a single event handler in ReactJS?

Raju Dandigam
Raju Dandigam
Updated on 14-Apr-2025 196 Views

Passing multiple props in a single event handler in ReactJS can be useful for situations where more than one value needs to be worked on based on some user input. In this article, we will discuss three different ways to pass props in a single event handler in ReactJS. Here is a list of approaches: Using Arrow Functions Using bind() Method Using Event Object Using Arrow Functions To pass multiple props in a single event handler, we will use the most popular approach i.e. ...

Read More

Java program to compare two sets

Shriansh Kumar
Shriansh Kumar
Updated on 12-Apr-2025 2K+ Views

The given task is to write Java programs that compare two sets and check if they are equal or not. Here, Set is an interface of the Java Collection Framework that extends the Collection interface and stores unique elements. Set depicts the features of a mathematical set. Hence, it allows all those operations that we can perform on a mathematical set, such as union, comparison, intersection, etc. Since Set is an interface, we can't use its functionalities directly. For this purpose, we need a TreeSet class that implements the Set Interface and can access its methods. How to Compare Two Sets in ...

Read More

What are the differences between JTextField and JTextArea in Java?

Alshifa Hasnain
Alshifa Hasnain
Updated on 11-Apr-2025 5K+ Views

The main difference between JTextField and JTextArea in Java is that a JTextField allows entering a single line of text in a GUI application while the JTextArea allows entering multiple lines of text in a GUI application. JTextField The following are the key characteristics of JTextField in Java: A JTextFeld is one of the most important components that allow the user to an input text value in a single line format. A JTextField will generate an ActionListener interface when we trying to enter some input inside it. The JTextComponent is a superclass of JTextField that provides a common set ...

Read More
Showing 31161–31170 of 61,297 articles
Advertisements