Sudhir sharma has Published 1208 Articles

C Program for Pancake sorting?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:31:34

172 Views

This C Program Implements Pancake Sort on Array of Integers.Pancake sorting is a variation of the sorting problem in which the only allowed operation is to reverse the elements of some prefix of the sequence.Pancake sorting is the colloquial term for the mathematical problem of sorting a disordered stack of ... Read More

Alternate vowel and consonant string in C/C++?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:29:16

266 Views

There is a string given, rearrange characters in the string such that the vowels and consonants occupy the alternate position. If string can’t be rearranged in the above manner, print “not possible”.The order of vowels with respect to each other and the order of consonants with respect to each other ... Read More

C/C++ Program for Finding the Number Occurring Odd Number of Times?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:26:21

301 Views

A C++ program to find a number which occurs odd number of times in a given array of positive integers. In this array, all numbers occur even number of times.Input: arr[] = {5, 7, 8, 8, 5, 8, 8, 7, 7} Output: 7ExplanationUse two loops in which the outer loop ... Read More

C/C++ Program to Find the sum of Series with the n-th term as n^2 – (n-1)^2

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:24:03

207 Views

There are many types of series in mathematics which can be solved easily in C programming. This program is to find the sum of following of series in C program.Tn = n2 - (n-1)2Find the sum of all of the terms of series as Sn mod (109 + 7) and, ... Read More

"static const" vs "#define" vs "enum" ?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:22:23

5K+ Views

"static const"“static const” is basically a combination of static(a storage specifier) and const(a type qualifier).The static determines the lifetime and visibility/accessibility of the variable. This means if a variable is declared as a static variable, it will remain in the memory the whole time when the program is running, while ... Read More

"delete this" in C++?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:19:16

1K+ Views

Delete is an operator that is used to Deallocate storage space of Variable.This pointer is a kind of pointer that can be accessed but only inside nonstatic member function and it points to the address of the object which has called the member function.This pointer holds the address of the ... Read More

C/C++ Tokens?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:13:18

8K+ Views

C++ Tokens are the smallest individual units of a program.C++ is the superset of C and so most constructs of C are legal in C++ with their meaning and usage unchanged. So tokens, expressions, and data types are similar to that of C.Following are the C++ tokens : (most of ... Read More

Add n binary strings?

sudhir sharma

sudhir sharma

Updated on 20-Aug-2019 08:08:41

200 Views

In this program we have to add binary numbers given. there are n binary numbers and we have to add them all to give one binary number as an output.For this we will use binary addition logic and add all the terms from 1 to N one by one to ... Read More

C/C++ Program to Find the reminder of array multiplication divided by n?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 12:58:56

100 Views

Array multiplication we will find the product of all elements of the given array. and then according to the problem, we will divide the product with the number n. let's take an example −Input: arr[] = { 12, 35, 69, 74, 165, 54};       N = 47 Output: ... Read More

C++ Program for QuickSort?

sudhir sharma

sudhir sharma

Updated on 19-Aug-2019 12:57:53

1K+ Views

Quicksort is a sorting technique which uses comparisons to sort an unsorted list( array ). Quicksort is also known as partition exchange sort.It is not a stable sort, Because the relative order of equal sort items is not preserved. Quicksort can operate on an array, requiring small additional amounts of ... Read More

Advertisements