Arjun Thakur has Published 1109 Articles

C++ Program to Find SSSP (Single Source Shortest Path) in DAG (Directed Acyclic Graphs)

Arjun Thakur

Arjun Thakur

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

1K+ Views

This is a C++ program to find SSSP (Single Source Shortest Path) in DAG (Directed Acyclic Graphs) using Dijkstra Algorithm to find out from the first node in graph to every other node with the shortest path length showed beside each pair of vertices.AlgorithmBegin    Take the elements of the ... Read More

Search multiple fields for multiple values in MongoDB?

Arjun Thakur

Arjun Thakur

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

521 Views

To search multiple fields for multiple values in MongoDB, you can use $text and $search operator. Let us first create a collection with documents>db.searchMultipleFieldsDemo.insertOne({"_id":100, "FirstSubject":"Java", "SecondSubject":"MongoDB"}); { "acknowledged" : true, "insertedId" : 100 } >db.searchMultipleFieldsDemo.insertOne({"_id":101, "FirstSubject":"MongoDB", "SecondSubject":"MySQL"}); { "acknowledged" : true, "insertedId" : 101 } >db.searchMultipleFieldsDemo.insertOne({"_id":102, "FirstSubject":"MySQL", "SecondSubject":"Java"}); { "acknowledged" ... Read More

C++ Program to Find the Edge Connectivity of a Graph

Arjun Thakur

Arjun Thakur

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

437 Views

In this program we need to find the Edge Connectivity of a Graph. An Edge Connectivity of a Graph of a graph means it is a bridge, removing it graph will be disconnected. Number of connected components increases with the removing of bridge in a disconnected undirected graph.Functions and pseudocode:Begin ... Read More

Split a string and insert it as individual values into a MySQL table?

Arjun Thakur

Arjun Thakur

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

689 Views

You can achieve this with the help of prepared statement in MySQL. First you need to create a table. The query to create a table is as followsmysql> create table University - > ( - > UserId int, - > UniversityId ... Read More

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

556 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

379 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

324 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

186 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

1K+ 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

186 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

Advertisements