Anvi Jain has Published 629 Articles

C++ Program to Implement Randomized Binary Search Tree

Anvi Jain

Anvi Jain

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

556 Views

A Binary Search Tree is a sorted binary tree in which all the nodes have the following few 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 less than or equal to its parent ... Read More

Meaning of 'const' last in a function declaration of a C++ class?

Anvi Jain

Anvi Jain

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

709 Views

Sometimes we can find the keyword ‘const’ present at the last of function declaration. So what does it mean?Using this one function can be made as constant. The idea of constant function is that, the function cannot be modified from the objects, where they are called. It is recommended to ... Read More

How to print local time in Android sqlite?

Anvi Jain

Anvi Jain

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

94 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

Printing 1 to 1000 without loop or conditionals in C/C++

Anvi Jain

Anvi Jain

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

437 Views

Here we will see how to print 1 to 1000 without loop or any conditional statements. As the loops cannot be used, so we can try recursions, but here another constraint that, we cannot use the conditions also. So the base case of the recursion will not be used.Here we ... Read More

Need of long data type in C

Anvi Jain

Anvi Jain

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

314 Views

In C or C++, there are four different datatypes, that are used for integer type data. These four datatypes are short, int, long and long long. Each of these datatypes takes different memory spaces. The size varies in different architecture and different operating systems. Sometimes int takes 4-bytes or sometimes ... Read More

Find value in a MongoDB Array with multiple criteria?

Anvi Jain

Anvi Jain

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

456 Views

To find value in the array with multiple criteria, for example, you can use $elemMatch along with $gt and $lt. The syntax is as follows −db.yourCollectionName.find({yourFieldName:{$elemMatch:{$gt:yourNegativeValue, $lt:yourPo sitiveValue}}}).pretty();To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is ... Read More

What is a reentrant function in C/C++?

Anvi Jain

Anvi Jain

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

4K+ Views

Here we will see what is the reentrant function in C or C++. One function is said to be a reentrant function if there is a provision to interrupt that function in the course of execution, then service the ISR (Interrupt Service Routine) and then resume the task. This type ... Read More

Collectors.joining() method in Java 8

Anvi Jain

Anvi Jain

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

2K+ Views

The joining() method of the Collectors class in Java 8 returns a Collector that concatenates the input elements into a String, in encounter order.The syntax is as follows −public static Collector joining()Here, CharSequence is a readable sequence of char values, whereas String class represents character strings.To work with Collectors class ... Read More

How to write a singleton class in C++?

Anvi Jain

Anvi Jain

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

1K+ Views

Singleton design pattern is a software design principle that is used to restrict the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. For example, if you are using a logger, that writes logs to a file, ... Read More

Multiline macros in C

Anvi Jain

Anvi Jain

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

3K+ Views

In this section we will see, how can write multiline macros in C. We can write multiline macros like functions, but for macros, each line must be terminated with backslash ‘\’ character. If we use curly braces ‘{}’ and the macros is ended with ‘}’, then it may generate some ... Read More

Advertisements