Anvi Jain has Published 629 Articles

How to perform descending order sort in MongoDB?

Anvi Jain

Anvi Jain

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

309 Views

To sort in ascending order, the syntax is as follows −db.yourCollectionName.find().sort({yourField:1});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.sortingDemo.insertOne({"Value":100}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8f8e2ed3c9d04998abf006") } > db.sortingDemo.insertOne({"Value":1}); {   ... Read More

C++ Program to Implement Double Order Traversal of a Binary Tree

Anvi Jain

Anvi Jain

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

136 Views

Here is a C++ Program to Implement Double Order Traversal of a Binary Tree.In Double Order Traversal, the root of the subtree is will be traversed twice.AlgorithmBegin    class BST has following functions:       insert() = to insert items in the tree:          Enter the ... Read More

C++ Program to Find Strongly Connected Components in Graphs

Anvi Jain

Anvi Jain

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

540 Views

Weakly or Strongly Connected for a given a directed graph can be found out using DFS. This is a C++ program of this problem.Functions usedBegin Function fillorder() = fill stack with all the vertices.    a) Mark the current node as visited and print it    b) Recur for all ... Read More

IntStream filter() method in Java

Anvi Jain

Anvi Jain

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

411 Views

The filter() method of the IntStream class in Java returns a stream consisting of the elements of this stream that match the given predicate.The syntax is as follows −IntStream filter(IntPredicate predicate)Here, the predicate parameter is a stateless predicate to apply to each element to determine if it should be included. ... Read More

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

Anvi Jain

Anvi Jain

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

529 Views

To find the Vertex Connectivity of a graph we need to find out Articulation Points of that graph. Articulation Points (or Cut Vertices) in a Graph is a point iff removing it (and edges through it) disconnects the graph. An articulation point for a disconnected undirected graph, is a vertex ... Read More

C++ Program to Implement the Solovay-Strassen Primality Test to Check if a Given Number is Prime

Anvi Jain

Anvi Jain

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

228 Views

Solovay-Strassen Primality Test is used to test a number whether it is a composite or possibly prime number.AlgorithmsBegin    Declare a function modulo to the long datatype to perform binary calculation.       Declare m_base, m_exp, m_mod of long datatype and pass them as a parameter.       ... Read More

How to convert date and time into int in Android sqlite?

Anvi Jain

Anvi Jain

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

202 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

DoubleStream allMatch() method in Java

Anvi Jain

Anvi Jain

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

75 Views

The allMatch() method in the DoubleStream class returns whether all elements of this stream match the provided predicate.The syntax is as follows −boolean allMatch(DoublePredicate predicate)Here, the argument predicate is a stateless predicate to apply to elements of this stream. The DoublePredicate is a predicate of one double-valued argument.To use the ... Read More

C++ Program to Implement Fusion Tree

Anvi Jain

Anvi Jain

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

464 Views

A fusion tree is a tree data structure that implements an associative array on w-bit integers. This is a C++ Program to Implement Fusion Tree Which generated an array of 6-bit integers on given binary tree as input.AlgorithmRequired functions and inputs −Begin    Take the no of elements of the ... Read More

Macros and Preprocessors in C

Anvi Jain

Anvi Jain

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

3K+ Views

The C Preprocessor is not a part of the compiler, but is a separate step in the compilation process. In simple terms, a C Preprocessor is just a text substitution tool and it instructs the compiler to do required pre-processing before the actual compilation. We'll refer to the C Preprocessor ... Read More

Advertisements