Arjun Thakur has Published 1025 Articles

C++ Program to Implement a Heuristic to Find the Vertex Cover of a Graph

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

826 Views

Vertex Cover of a Graph is to find a set of vertices V, such that for every edge connecting M to N in graph, either M or N (or both) are present in V. In this program, we Implement a Heuristic to Find the Vertex Cover of a Graph.AlgorithmBegin   ... Read More

How to get default phone Network Country Iso in android?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

557 Views

This example demonstrate about How to get default phone Network Country Iso in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     ... Read More

How to iterate over all MongoDB databases?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

403 Views

To iterate over all MongoDB databases, you need to switch your database to admin. Following is the query to switch to admin and get information about all the databases> switchDatabaseAdmin = db.getSiblingDB("admin"); admin > allDatabaseName = switchDatabaseAdmin.runCommand({ "listDatabases": 1 }).databases;This will produce the following output[    {       ... Read More

C++ Program to Perform Edge Coloring on Complete Graph

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

330 Views

A complete graph is a graph which has a connecting edge between any pair of vertices. This is a C++ Program to Perform Edge Coloring on Complete Graph.AlgorithmBegin    Take the input of the number of vertices ‘n’.    Construct a complete graph using e=n*(n-1)/2 edges, in ed[][].    Function ... Read More

Is it possible to calculate a correlation in a MySQL query?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

2K+ Views

Yes, it is possible to calculate a correlation in a query. To understand the correlation in a query, you need to first create a table. The query to create a table is as followsmysql> create table correlationDemo - > ( - > value float ... Read More

Namespace in C++

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

247 Views

Consider a situation, when we have two persons with the same name, Zara, in the same class. Whenever we need to differentiate them definitely we would have to use some additional information along with their name, like either the area, if they live in different area or their mother’s or ... Read More

DoubleStream summaryStatistics() method in Java

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

141 Views

The summaryStatistics() method of the DoubleStream class returns a DoubleSummaryStatistics describing various summary data about the elements of this stream. This is a special case of a reduction.The syntax is as followsDoubleSummaryStatistics summaryStatistics()Here, DoubleSummaryStatistics is a state object for collecting statistics such as count, min, max, average, etc. It works ... Read More

How to count the number of documents in a MongoDB collection?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

552 Views

Following is the syntax to count the number of documents in a MongoDB collectionlet anyVariableName= db.getCollection(‘yourCollectionName’); yourVariableName.count();Let us first create a collection with documents> db.countNumberOfDocumentsDemo.insertOne({"CustomerName":"Bob"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9a5e2015e86fd1496b38a1") } >db.countNumberOfDocumentsDemo.insertOne({"CustomerName":"Ramit", "CustomerAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9a5e3515e86fd1496b38a2") } >db.countNumberOfDocumentsDemo.insertOne({"CustomerName":"Adam", "CustomerAge":27, "CustomerCountryName":"US"}); ... Read More

How can I the date of creation and updation of tables in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

249 Views

Get the create and update tables exact date using the create_time or update_time in MySQL.At first, use the SHOW command. The syntax is as followsSHOW TABLE STATUS;We are considering our database ‘test3’, which is already having some tablesmysql> use test3; Database changedNow use the following query to display all the ... Read More

LongStream of() method in Java

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

151 Views

The LongStream class in Java the following two forms of the of() method.The following of() method returns a sequential LongStream containing a single element. Here is the syntaxstatic LongStream of(long t)Here, parameter t is the single element.The following of() method returns a sequential ordered stream whose elements are the specified ... Read More

Advertisements