Daniol Thomas has Published 209 Articles

LongStream map() method in Java

Daniol Thomas

Daniol Thomas

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

76 Views

The map() method of the LongStream class in Java returns a stream consisting of the results of applying the given function to the elements of this stream.The syntax is as follows:LongStream map(LongUnaryOperator mapper)Here, the parameter mapper is a stateless function to apply to each element. The LongUnaryOperator represents an operation ... Read More

What are bind variables? How to execute a query with bind variables using JDBC?

Daniol Thomas

Daniol Thomas

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

5K+ Views

A bind variable is an SQL statement with a temporary variable as place holders which are later replaced with appropriate values. For example, if you have a table named employee in the database created as shown below:+---------+--------+----------------+ | Name | Salary | Location ... Read More

How to write a JDBC program to extract data from multiple databases?

Daniol Thomas

Daniol Thomas

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

965 Views

To connect with a data base, you need toRegister the DriverSelect the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connectionCreate a connection object by passing the URL of the ... Read More

C++ Program to Perform Greedy Coloring

Daniol Thomas

Daniol Thomas

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

670 Views

Here is a C++ Program to Perform Greedy ColoringAlgorithm:Begin    Take the number of vertices and edges as input.    Create function greedyColoring() to assign color to vertices:    A) Assign the first color to first vertex.    B) Initialize the remaining vertices.    C) Declare a temporary array to ... Read More

C++ Program to Find Maximum Number of Edge Disjoint Paths

Daniol Thomas

Daniol Thomas

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

101 Views

This is a C++ program to find Maximum Number of Edge Disjoint Paths which means shortest subset path or maximum flow between two vertices.Algorithms:Begin    function bfs() returns true if there is path from source s to sink t in    the residual graph which indicates additional possible flow in ... Read More

How to insert new documents into a MongoDB collection in your database?

Daniol Thomas

Daniol Thomas

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

232 Views

To insert new documents into a MongoDB collection, you need to use insert() method or save() method.Case 1: Using insert() method.The syntax is as follows:db.yourCollectionName.insert(yourDocument);Case 2: Using save() method.The syntax is as follows:db.yourCollectionName.save(yourDocument);In the above syntax, if your collection name does not exist then MongoDB will create a new collection ... Read More

C++ Program to Perform Operations in a BST

Daniol Thomas

Daniol Thomas

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

2K+ Views

         A Binary Search Tree is a sorted binary tree in which all the nodes will have following properties−The right sub-tree of a node has a key greater than to its parent node's key.The left sub-tree of a node has a key lesser than to its parent ... Read More

C++ Program to Implement Network_Flow Problem

Daniol Thomas

Daniol Thomas

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

448 Views

This is a C++ Program to implement Network_Flow problem using Ford Fulkerson algorithm.Algorithms:Begin    function bfs() returns true if there is path from source s to sink t in    the residual graph which indicates additional possible flow in the graph. End Begin    function fordfulkarson() return maximum flow in ... Read More

How to delete documents from a collection in MongoDB?

Daniol Thomas

Daniol Thomas

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

338 Views

To delete the documents from a collection in MongoDB, you need to use remove() method. The syntax is as follows:db.yourCollectionName.remove(yourDeleteValue);Here, let us create a collection with some documents. The query is as follows:>db.deleteDocuments.insert({"UserId":1, "UserName":"Bob", "UserTechnicalSubject":"Introducti on to PL/SQL"}); WriteResult({ "nInserted" : 1 }) >db.deleteDocuments.insert({"UserId":2, "UserName":"Carol", "UserTechnicalSubject":"Introduction to MongoDB"}); WriteResult({ ... Read More

C++ Program to Implement The Edmonds-Karp Algorithm

Daniol Thomas

Daniol Thomas

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

3K+ Views

This is a C++ Program to Implement the Edmonds-Karp algorithm to calculate maximum flow between source and sink vertex.Algorithm:Begin    function edmondsKarp() :       initiate flow as 0.       If there is an augmenting path from source to sink, add the path to flow.     ... Read More

Advertisements