Sudhir sharma has Published 1149 Articles

C++ Program for Longest Common Subsequence

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 07:16:44

3K+ Views

A subsequence is a sequence with the same order of the set of elements. For the sequence “stuv”, the subsequences are “stu”, “tuv”, “suv”, .... etc.For a string of length n, there can be 2n ways to create subsequence from the string.ExampleThe longest common subsequence for the strings “ ABCDGH ... Read More

C++ program for hashing with chaining

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 07:13:39

2K+ Views

Hashing is the method by which we can map any length data element to a fixed size key. hashing works as key-value pairs.Hashing function is the function that does the mapping in a hash map. the data elements that are given as input to the Hash Function may get same ... Read More

C++ Mathematical Functions

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 07:05:50

3K+ Views

Mathematical calculations can be done in C++ programming language using the mathematical functions which are included in math or cmath library. These mathematical functions are defined to do complex mathematical calculations. Let’s learn each of them one by one −sineThe sin method is used to calculate the sin of the ... Read More

C++ map having key as a user defined data type

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 06:52:55

1K+ Views

A map is a data structure that stores information in the form of key and value pairs. In C++, map is defined in STL (standard template library) and store keys in an ordered form.Syntax to define a map −map map_name;The data type of any of these two data of the ... Read More

C++ interview questions on virtual function and abstract class

sudhir sharma

sudhir sharma

Updated on 19-Sep-2019 06:44:52

1K+ Views

What is a virtual function?A virtual function is a method that does not have a definition when defined in the base class. This method is left black in the parent class and it is redefined in the child class.What is an abstract class?An abstract class is a class that has ... Read More

C Program for Rat in a Maze - Backtracking-2?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 10:25:14

3K+ Views

Rat in a maze is also one popular problem that utilizes backtracking. IA maze is a 2D matrix in which some cells are blocked. One of the cells is the source cell, from where we have to start. And another one of them is the destination, where we have to ... Read More

C++ Program to remove spaces from a string?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 09:02:02

1K+ Views

The program takes a string and removes the spaces in it. This is useful when we want to save the space of our The following sample shows how it is done with an explanation.Input: Hello World Output: HelloWorldExplanationTo remove or delete spaces from the string or sentence, you have to ... Read More

C Program to Find the minimum sum of factors of a number?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:50:59

411 Views

The program to find the minimum sum of factors of a number. The logic for solving this problem is, find all the set of factors and adding them. For every set of factors, we will do the same and then compare all of them. Then find all the minimum of ... Read More

C Program to count the number of lines in a file?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:49:43

9K+ Views

In this program, we are going to learn how to find the total number of lines available in a text file using C program?This program will open a file and read the file’s content character by character and finally return the total number of lines in the file. To count ... Read More

C Program to Compute Quotient and Remainder?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:47:43

431 Views

Given two numbers dividend and divisor. The task is to write a program to find the quotient and remainder of these two numbers when the dividend is divided by the divisor.In division, we will see the relationship between the dividend, divisor, quotient, and remainder. The number which we divide is ... Read More

Advertisements