Smita Kapse has Published 559 Articles

C/C++ Struct vs Class

Smita Kapse

Smita Kapse

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

272 Views

In C++ the structure and class are basically same. But there are some minor differences. These differences are like below.The class members are private by default, but members of structures are public. Let us see these two codes to see the differences.Example#include using namespace std; class my_class {   ... Read More

C++ Program to Implement Disjoint Set Data Structure

Smita Kapse

Smita Kapse

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

3K+ Views

Disjoint set is basically as group of sets where no item can be in more than one set. It supports union and find operation on subsets.Find(): It is used to find in which subset a particular element is in and returns the representative of that particular set.Union(): It merges two ... Read More

Why would we call cin.clear() and cin.ignore() after reading input in C++?

Smita Kapse

Smita Kapse

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

1K+ Views

In C++ the cin is used to take input from user. Sometimes for some reasons some error flags are set. In that time the cin does not take any input. Sometimes it takes some other characters. So if we clear the cin, then the error flags are reset. Then we ... Read More

C++ Program to Implement Gauss Seidel Method

Smita Kapse

Smita Kapse

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

3K+ Views

Gauss Seidel method is used to solve linear system of equations in iterative method. This is a C++ Program to Implement Gauss Seidel Method.AlgorithmBegin    Take the dimensions of the matrix p and its elements as input.    Take the initials values of x and no of iteration q as ... Read More

C++ Program to Perform Optimal Paranthesization Using Dynamic Programming

Smita Kapse

Smita Kapse

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

135 Views

This is a C++ program to perform Optimal Paranthesization using Dynamic Programming.AlgorithmBegin    Take the length n and dimension of matrix as input.    MatrixChain() to find out minimum multiplications:    Arguments:       a[i][j]=Minimum number of scalar multiplications needed to          compute the matrix A[i]A[i+1]...A[j] ... Read More

Single quotes vs. double quotes in C or C++

Smita Kapse

Smita Kapse

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

7K+ Views

In C and C++ the single quote is used to identify the single character, and double quotes are used for string literals. A string literal “x” is a string, it is containing character ‘x’ and a null terminator ‘\0’. So “x” is two-character array in this case.In C++ the size ... Read More

How do you declare an interface in C++?

Smita Kapse

Smita Kapse

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

332 Views

An interface describes the behavior or capabilities of a C++ class without committing to a particular implementation of that class.The C++ interfaces are implemented using abstract classes and these abstract classes should not be confused with data abstraction which is a concept of keeping implementation details separate from associated data.A ... Read More

C++ Program to Find Maximum Value of any Algebraic Expression

Smita Kapse

Smita Kapse

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

208 Views

This is a C++ Program to Find Maximum Value of any Algebraic Expression.An algebraic expression of the form (x1 + x2 + x3 + . . . + xa) * (y1 + y2 + . . . + yb) and (a + b) integers is given.consider all possible combinations of ... Read More

How to use replaceAll () in Android textview?

Smita Kapse

Smita Kapse

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

385 Views

This example demonstrate about How to use replaceAll () 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 find through list of ids in MongoDB?

Smita Kapse

Smita Kapse

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

2K+ Views

You can use $in operator to find through the list of ids in MongoDB. 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.findListOfIdsDemo.insertOne({"StudentName":"Carol", "StudentAge":21}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ecadd2f684a30fbdfd575") ... Read More

Advertisements