Sakhi Bhagwat

Sakhi Bhagwat

4 Articles Published

Articles by Sakhi Bhagwat

4 articles

How to Take Input from User Separated by Space in Java?

Sakhi Bhagwat
Sakhi Bhagwat
Updated on 24-Jul-2023 6K+ Views

Input and output are the vital components of all the programming languages. Same is the case with Java. User input is very crucial for creating dynamic and interactive applications. Usually the input is a single value but we can also take input from the user separated by space. This article deals with how to take input from the user separated by spaces in Java. Ways to Take Input From User Separated By Space in Java There are 2 ways by which we can take the input from the user separated by space. They are as follows- ...

Read More

How to Create a User-Defined Javap Tool?

Sakhi Bhagwat
Sakhi Bhagwat
Updated on 24-Jul-2023 280 Views

At times, we need information related to a class file. In such a case, we can use the javap tool provided by the Java Development Kit (JDK). We can get more information related to the methods, constructors, and fields present in the class. The purpose of the javap tool is to disassemble one or more class files. It is also known as Java Class File Disassembler. Using the javap tool, we can get more information about the bytecode information about that particular class. The output may vary depending on the options used. Syntax The syntax of javap is ...

Read More

How to Create a TreeSet with a List in Java?

Sakhi Bhagwat
Sakhi Bhagwat
Updated on 24-Jul-2023 1K+ Views

A TreeSet in Java stores unique elements in sorted order. It implements the SortedSet interface. The TreeSet interface internally uses a balanced tree called the Red-Black tree. A List in Java is a data structure that is used to store elements in the order in which they were added. We can create a TreeSet with a List in Java in many ways. This article deals with the ways in which a TreeSet can be created using a List in Java. Ways to Create a TreeSet with a List in Java There are 3 ways by which a TreeSet ...

Read More

Find the Number of Paths of Length K in a Directed Graph

Sakhi Bhagwat
Sakhi Bhagwat
Updated on 24-Jul-2023 711 Views

You are given a directed and unweighted graph G and an integer K. You have to find the number of paths in the graph of length K. Here the graph is in the form of an adjacency matrix. From vertex i to j, if there exists an edge, it is denoted by G[i][j]=1 else denoted by G[i][j]=0. Input A directed and unweighted graph represented by an adjacency matrix Integer K that denotes the length of path to be found Output Total number ...

Read More
Showing 1–4 of 4 articles
« Prev 1 Next »
Advertisements