Count Number Of Duplicates Elements Present In Array
You need to count Number of duplicates elements present in an array that occurs two or more times.
For Example:
Input: arr = 1,2,3,1,1,2,4,5,2,3
Output : 3 (1 present 3 times, 2 present 3 times , 3 present...
Tuesday, 11 October 2016
Friday, 7 October 2016
Monday, 3 October 2016
A Program to check if strings are rotations of each other or not
A Program to check if strings are rotations of each other or not
String-Rotations
#include <iostream>
#include <cstring>
#include<string>
using namespace std;
void CompareString(string, string, int);
int ComputeLength(string str);
int main()
{
string str = ""; string...
Sunday, 2 October 2016
Interview Question #1
What happens if you Call a free on a pointer twice?
Deallocating a memory area with free does not make the contents of the pointer NULL.
Suppose that you have int *a = malloc (sizeof (int)) and a has 0xdeadbeef and you execute free (a) then after execution a still contains 0xdeadbeef but...
Calculate Sum Of All Numbers Present In String
Calculate sum of all numbers present in a string
sum-of-all-digits-present-in-a-string
#include <iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int SumOfDigits(string str, int n);
int SumOfoverallNumberPresent_In_Sequence(string str, int n);
int...