Anvi Jain has Published 629 Articles

STL Priority Queue for Structure or Class in C++

Anvi Jain

Anvi Jain

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

539 Views

STL Priority Queue is the implementation of maxheap.This is a C++ program of STL priority queue for structure.AlgorithmBegin    Define a structure of type student.    Initialize variables in student structure.    Define another structure of type comparemarks    Overload the variables of student structure in comapremarks    structure.   ... Read More

IntStream findAny() method in Java

Anvi Jain

Anvi Jain

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

85 Views

The findAny() method of the IntStream class in Java is used to return an OptionalInt describing some element of the stream, or an empty OptionalInt if the stream is empty.The syntax is as follows −OptionalInt findAny()Here, OptionalInt is a container object which may or may not contain an int value.Create ... Read More

How to update all documents in MongoDB?

Anvi Jain

Anvi Jain

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

696 Views

You can use updateMany() to update documents. Let us create a collection with a document. The query to create a collection with a document is as follows −> db.updateManyDocumentsDemo.insertOne({"StudentName":"John", "StudentLastName":"Smith"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c948edd4cf1f7a64fa4df48") } > db.updateManyDocumentsDemo.insertOne({"StudentName":"John", "StudentLastName":"Doe"}); {    "acknowledged" : true,    "insertedId" ... Read More

unordered_multimap reserve() function in C++ STL

Anvi Jain

Anvi Jain

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

101 Views

The unordered_multimap reserve() function in C++ STL sets the number of buckets in the container to the most appropriate number so that it contains at least n elements.If n is greater than the current numbers of bucket multiplied by the max_load_factor, the container’s number of buckets is increased and a ... Read More

unordered_multimap swap() function in C++ STL

Anvi Jain

Anvi Jain

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

99 Views

unordered_multimap swap() function in C++ STL is used to swap the elements of one multimap to another of same size and type.AlgorithmBegin    Declaring two empty map container m, m1.    Insert some values in both m, m1 map containers.    Perform swap() function to swap the values of m, ... Read More

How to use LIMIT Cause in Android sqlite?

Anvi Jain

Anvi Jain

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

386 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

vector::begin() and vector::end() in C++ STL

Anvi Jain

Anvi Jain

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

4K+ Views

vector::begin() function is a bidirectional iterator used to return an iterator pointing to the first element of the container.vector::end() function is a bidirectional iterator used to return an iterator pointing to the last element of the container.AlgorithmBegin    Initialize the vector v.    Declare the vector v1 and iterator it ... Read More

How to find leap year or not in android using year API class?

Anvi Jain

Anvi Jain

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

268 Views

This example demonstrate about How to find leap year or not in android using year API class.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 list all databases in the Mongo shell?

Anvi Jain

Anvi Jain

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

650 Views

To list all databases in the Mongo shell, you need to use show command. The syntax is as follows −show dbs;Let us implement the above syntax for MongoDB. The query is as follows −> show dbs;The following is the output −admin 0.000GB config 0.000GB local 0.000GB sample 0.000GB sampleDemo 0.000GB ... Read More

C++ Program for Inorder Tree Traversal without Recursion

Anvi Jain

Anvi Jain

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

518 Views

If a binary tree is traversed in-order, the left subtree is visited first, then the root and later the right sub-tree. The output the key in ascending order in in_order traversal. This is a C++ Program for Inorder Tree Traversal without Recursion.AlgorithmBegin      Function inOrder():       Declare ... Read More

Advertisements