Monday, 28 December 2015
Friday, 25 December 2015
Monday, 30 November 2015
Saturday, 31 October 2015
Occurence of a number in Sorted Array/Vector using Recursion
#include<iostream>
#include<vector>
using namespace std;
int Frequency(std::vector<int> &v, int k, int start, int end)
{
if (start > end)
return 0;
int mid = (start + end) / 2;
if (v[mid] < k)
return Frequency(v, k, mid + 1, end);
if (v[mid] > k)
return Frequency(v, k, start, mid - 1);
return Frequency(v, k, start, mid - 1) + 1 + Frequency(v, k, mid + 1, end);
}
int main()
{
int arr[] ={2,2,3,3,5,5,5};//Sorted Array
std::vector<int> v(arr, arr+7);
int k;
std::cin>>k;
std::cout<<Frequency(v, k, 0, v.size()-1);
getchar();
}
Sunday, 18 October 2015
grep - Linux Command
Most of the general linux commands are available online but here i will be covering bit advance feature of some linux commands
grep
We use grep command to search contents in a file or directory.What will be command for searching only in specific extension files in a directory.Lets find out below
grep
We use grep command to search contents in a file or directory.What will be command for searching only in specific extension files in a directory.Lets find out below
- Recursively Search a pattern in all files of a directory use
- To Search a pattern only in files with specific extensions in a directory use
- To Search a pattern in files with multiple extensions in a directory use
- Case insensitive Search of a pattern
Saturday, 29 August 2015
Technical Things to Know
- Distributed Objects refers to software modules that are designed to work together, but reside either in multiple computers connected via a network or in different processes inside the same computer.
- DCOM is a framework for distributed objects on the Microsoft platform.
Friday, 31 July 2015
auto_ptr
Note: auto_ptr has been deprecated in C++11 and unique_ptr has taken its place.
Thursday, 14 May 2015
Subscribe to:
Posts (Atom)