Solution for Problem 4:
#includeiostream
#define size 10 //size = sizeof(arr);
#define max 8 //max = maxof(arr[])+1;
using namespace std;
int main()
{
int arr[] = {2,4,6,4,6,3,5,1,5,7}, hasharr[max] = {0}, i, sum=8;
for(i=0; isize; i++)
hasharr[arr[i]] = 1;
code::
#include stdio.h
#includeconio.h
void check(int count, int k,int max)
{
int right,leftmost,rightmost;
if(k==1)
return;
right=count(-count);
leftmost=count+right;
rightmost=count^leftmost;
rightmost=rightmost/right;
rightmost=rightmost2;
good question..
With regards,
Praveen Raj
DCE-IT 3rd yr
735993
praveen0...@gmail.com
On Tue, Sep 27, 2011 at 6:40 AM, Kunal Patil kp101...@gmail.com wrote:
Nice question nice answer... :)
On Tue, Sep 27, 2011 at 6:25 AM, UTKARSH SRIVASTAV
usrivastav...@gmail.com wrote:
what's
when the vtable of a class (if it has a virtual function ) is created
and loaded in memory
1. at the time of class declaration (before the 1st object of that
class is created)
2. when the 1st object of that class is created
3. its compiler dependent .(not specified by c++ standard)
--
You
@meng You already have the pattern figured out. each time subtract 1
from the lowest digit and add to higher digit(only once), until the
lowest digit equals to closest higher digit. the selection of which
number to start could be figured out with given parameters sum and
combination
@Prem, no
The Virtual tables are contructed during compile time . The compiler
create a pointer vptr to point to the vtable during but it doesn't
contain the address of the function which is declared as virtual
because it is still not loaded in memory . Becoz is suppose to link
the modules and header files
+1 Prem
@ligerdave : I knew about the recursion method..but can u throw some light
on the pointer based method..(with a small example maybe)..
Specifically I wanted to know the implementation part and the running time
of the algorithm.
On Wed, Oct 26, 2011 at 8:33 PM, ligerdave