Anvi Jain has Published 629 Articles

How to use toUpperCase () in Android textview?

Anvi Jain

Anvi Jain

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

387 Views

This example demonstrate about How to use toUpperCase () in Android textview.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 users in the Mongo shell?

Anvi Jain

Anvi Jain

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

12K+ Views

In order to list all users in the Mongo shell, use the getUsers() method or show command.Case 1 − Using getUsers()The syntax is as follows −db.getUsers();Case 2 − Using show commandThe syntax is as follows −show users;Let us implement both the syntaxes in order to list all users in the ... Read More

MongoDB SELECT COUNT GROUP BY?

Anvi Jain

Anvi Jain

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

226 Views

You can achieve this with the help of an aggregate framework. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.countGroupByDemo.insertOne({"StudentId":10, "StudentName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c7700871e9c5dd6f1f78296") } > db.countGroupByDemo.insertOne({"StudentId":10, ... Read More

Execute both if and else statements in C/C++ simultaneously

Anvi Jain

Anvi Jain

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

286 Views

In this section, we will see how to execute the if and else section simultaneously in a C or C++ code. This solution is a little bit tricky.When the if and else are executed one after another then it is like executing statements where if-else are not present. But here ... Read More

How to create a nested index in MongoDB?

Anvi Jain

Anvi Jain

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

366 Views

To create nested index in MongoDB, you can use createIndex() or ensureIndex(). The syntax is as follows −db.yourCollectionName.createIndex({"yourOuterFieldName.yourInnerFieldName.yourSecondInnerFieldName": 1});To understand the syntax, let us create a collection with the document. The query to create a collection with a document is as follows −> db.nestedIndexDemo.insertOne(    ... {       ... Read More

C++ Program to Find Minimum Number of Edges to Cut to make the Graph Disconnected

Anvi Jain

Anvi Jain

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

278 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 pseudocodeBegin ... Read More

MongoDB query with fields in the same document?

Anvi Jain

Anvi Jain

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

119 Views

You can use $where operator for this. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.queryInSameDocumentsDemo.insertOne({"StudentDetails":{"StudentName":"John"}, "NewStudentDetails":{"StudentName":"Carol"}}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c90096ed3c9d04998abf017") } > db.queryInSameDocumentsDemo.insertOne({"StudentDetails":{"StudentName":"Bob"}, "NewStudentDetails":{"StudentName":"Bob"}}); {    "acknowledged" ... Read More

C++ Program to Implement a Binary Search Tree using Linked Lists

Anvi Jain

Anvi Jain

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

2K+ Views

Here is a C++ program to Implement a Binary Search Tree using Linked Lists.Functions and pseucodesAlgorithmBegin    Take the nodes of the tree as input.    Create a structure nod to take the data d, a left pointer l and a right r as input.    Create a function create() ... Read More

LongStream rangeClosed() method in Java

Anvi Jain

Anvi Jain

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

234 Views

The rangeClosed() method of the LongStream class in Java returns a sequential ordered LongStream from startInclusive to endExclusive by an incremental step of 1. This is inclusive of the initial element and the last element.The syntax is as follows −static LongStream rangeClosed(long startInclusive, long endExclusive)Here, startInclusive is the first value, ... Read More

C++ Program to Implement B+ Tree

Anvi Jain

Anvi Jain

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

3K+ Views

The B+ tree is a generalization of a binary search tree in that a node can have more than two children. It is basically a self-balancing tree data structure that maintains sorted data and allows sequential access, searches, insertions, and deletions in logarithmic time.It can be viewed as a B-tree ... Read More

Advertisements