Found 34488 Articles for Programming

Check if a graph constructed from an array based on given conditions consists of a cycle or not

Naveen Singh
Updated on 28-Jul-2023 11:34:05

119 Views

Introduction In graph theory, it is a very important task to figure out if a graph built from an array and meeting certain conditions has a cycle or not. A graph is an imaginary way to show how things are linked together. It is used in a lot of places, like computer networks and social networks. This article talks about the conditions for graph construction, the BFS and DFS algorithm, and a step by step guide how loops in a undirected graph is identified. Array Representation of a Graph An array-based method in graph theory stores vertices and edges in ... Read More

Check if a Binary String can be sorted in decreasing order by removing non-adjacent characters

Naveen Singh
Updated on 28-Jul-2023 12:46:14

77 Views

In this problem, we need to sort the given binary string in decreasing order by removing only non-adjacent elements. To solve the problem, we require to remove all zeros which are placed before ones in the binary string. If we find two consecutive ones after two consecutive zeros at any position in the string, it means we can’t sort the string in decreasing order. Otherwise, we can sort it out in each case. Problem statement − We have given binary string str with a length equal to N. We need to check whether we can sort the given string in ... Read More

Successor Graphs

Naveen Singh
Updated on 28-Jul-2023 11:32:13

484 Views

Introduction A Successor Graph is a model of a directed graph in which each node stores a list of the nodes that come after it. Successor graphs are better than an adjacency matrix or list because they speed up access to outgoing edges. This makes them perfect for algorithms that need quick access to successor vertices. This choice of design works well for graphs with a lot of points but not many edges Representation of Successor Graphs using Adjacency Matrix Successor graphs store only the direct successors of each vertex, reducing memory usage and speeding up edge insertion and deletion ... Read More

Print matrix elements using DFS traversal

Naveen Singh
Updated on 28-Jul-2023 11:26:51

400 Views

Introduction Depth-First Search (DFS) is a graph traversal method that looks at vertices and edges by starting at a certain node and going as far as possible down each branch before going back.It looks at the "depth" of the graph, starting with the node that is the deepest and then going back to look at other lines. Recursion or a stack can be used to make DFS work. It can be used to find paths, find cycles in graphs and vectors, and do exhaustive searches. Understanding the Matrix Structure In data analysis, a matrix is a two-dimensional array. Matrix data ... Read More

Maven Project with Junit – Checking for a Bank Account Number

Naveen Singh
Updated on 28-Jul-2023 11:05:49

94 Views

All the applications whether small or large are required to undergo a set of processes building, generating, compiling and running of the source code. These set of processes are manually performed by the programmers. However, with the launch of the Apache’s Maven Project, all these sets of processes can be automated and the manual work can be avoided. Therefore, the maven project is an open source tool that is used to build and deploy several projects at once for providing better project management. In this article, we will be discussing the Maven Project for checking a bank account number whether ... Read More

Maven Lifecycle and Basic Maven Commands

Naveen Singh
Updated on 28-Jul-2023 10:59:52

178 Views

The building process of projects is widely managed by developers using Maven, which is a popular build automation tool. With its foundation built upon the project object model (POM), this tool is available as an open-source option. The execution of phases that occur in an orderly manner results in building and deploying projects through the Maven lifecycle. Developers commonly use some basic Maven commands, and the Maven lifecycle will be discussed in this article. Maven Lifecycle The Maven lifecycle follows a specific order, beginning to end, for building and deploying projects. This built-in system encompasses three stages: ... Read More

What is MetaSpace in Java?

Naveen Singh
Updated on 28-Jul-2023 10:57:26

1K+ Views

"MetaSpace" is not a phrase that is generally used or recognised as part of the Java Programming language’s standard library or syntax. As a result, "MetaSpace" is likely to relate to anything specific to a particular Java programme or project, rather than a general Java idea. It is impossible to offer a detailed description or explanation of "MetaSpace" in Java without further context or infformation about the individual application or project. However, it’s possible that "MetaSpace" refers to thhe physical world rather than the digital or virtual world. It may be used in this context to distinguish between online or ... Read More

Mapping Java Beans to CSV Using OpenCSV

Naveen Singh
Updated on 28-Jul-2023 10:53:22

1K+ Views

In our digitized era where large amounts of information are produced every day around the globe; managing information storage methods efficiently has become crucially important to many domains -including businesses- in order to be successful . One alternative that has gained great popularity among users lately due its effective functionality along with convenience aspects; economical point of view could well be considered would be Comma Separated Values (CSV) file format. It's a text-based option which could help in storing, manipulating and transmitting data in an uncomplicated and lightweight way. Nonetheless, mapping CSVs to more intricate data structures examples like Java ... Read More

Mapping CSV to JavaBeans using OpenCSV

Naveen Singh
Updated on 28-Jul-2023 10:51:48

1K+ Views

CSV files are basically plain text files that stores data in columns separated a comma. OpenCSV is the library that parses these CSV files which are quite difficult to handle otherwise. It is a quite easy to use library that supports several features like reading and writing of CSV files with headers. We will be discussing the mapping of CSV files to JavaBeans via OpenCSV in this article. Additionally. OpenCSV is a tool that aids in this process. Mapping the CSV to JavaBeans The OpenCSV library provides certain classes and mapping strategies to map the CSV files into Java Beans. ... Read More

Main Components of Java NetBeans IDE

Naveen Singh
Updated on 28-Jul-2023 10:49:22

296 Views

Java developers frequently turn to the Java NetBeans IDE as an integrated development environment to build, manage and test their pieces of code. This open-source software tool comes free-of-charge and enjoys patronage from its supporting organization - Oracle Corporation. Additionally providing users with a plethora of tools complemented by various plugins that add functionality to the software tool whilst boasting an interface that's easy on users' eyes make it exceptionally convenient for adapting newbies' or more experienced programmers in equal measure - not surprising given that Java has taken root among programmers as one of the trending coding languages utilized ... Read More

Advertisements