we need to use + and - as operator overloading. so, that i will work f9 for
ur objects.
so make operator overloading for + and - operator.
On Sat, Nov 17, 2012 at 9:12 PM, AISHWARYA KUMAR aish@gmail.com wrote:
in one line
a=a^b^(b=a) ;
--
--
*Thanks and
We have given a list 14 6 7 15 8 9 we have to find 15 in (log
n ) times.
--
*Thanks and Regards,*
Abhinav Kumar Gupta
**abhinav@gmail.com
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
you can stop..
although space complexity has increased... you will need one redundant
array to use heap operation so that finally you will have original array as
it is...
Thanks and Regards:
Rahul Kumar Patle
On Sun, Jun 3, 2012 at 8:31 PM, abhinav gupta abhinav@gmail.comwrote:
We
@ Abhishek : Link that you have provided is for kth min element in the
unsorted array, but here i dont know the given value is of at what min
position.
On Sun, Jun 3, 2012 at 9:06 AM, abhinav gupta abhinav@gmail.com wrote:
@Rahul: but for heapify, i need to build heap tree first from
Aricent will not conduct test by itself. They'll have other organization
who will conduct the exams.
There are many test to be conducted in the time period of 2 or more. i just
forgot the time limit limit.
But the exams on apptitute, c language/java language either of
one, technical test, verbal
@vijay
can u plz shar some ques which will help us
On Fri, Sep 23, 2011 at 5:20 PM, vijay singh vijaysinghb...@gmail.comwrote:
Yes, it already visited..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
@rahul
+1
On Thu, Sep 22, 2011 at 11:20 PM, rahul vatsa vatsa.ra...@gmail.com wrote:
time is a keyword in c/cpp, change time to any other string in ur code nd
it will work.
On Thu, Sep 22, 2011 at 12:27 PM, Rajesh Kumar testalgori...@gmail.comwrote:
not working by changes provide by you
Whenver you call copy constructor it has to pass reference parameter beacuse
you dont want constructor and destructor to be called twice.
Here is the reason why,
Suppose u have two objects of a class (let 'a' and 'b').
when u want to copy 'a' into 'b' you want current status of object 'a' to be
@ Tammana : Can u explain the main logic of haveFactor() function inside
Prime.?
On Tue, Sep 20, 2011 at 11:28 AM, Tamanna Afroze afroze...@gmail.comwrote:
haveFactor() function checked the factor of a number.
if a number has a factor other than 1 and itself it isn't prime.
Operation function
Dats not the logic Tammana
you have to check whether there is any factor in between 2 to number/2;
if there is any no then u have to brak at that point.
On Tue, Sep 20, 2011 at 12:10 PM, Tamanna Afroze afroze...@gmail.comwrote:
I checked whether th enuber s divisible by 2 nd 3 repeatedly...
Welcum ! I think we need to discuss this 1 in gtalk...I think u still need
sm clarification in this 1
On Tue, Sep 20, 2011 at 12:33 PM, Tamanna Afroze afroze...@gmail.comwrote:
Thanks to all for the nice suggestions. thanks @abhianv and @siddhart.
I will try all the suggestions..
Tamanna
I can tell you the logic.Take two arrays N and M, put their bits in
the array.
Now using i and j index replace the value of N[j] to n[i] by M[j] to M[i].
On Tue, Sep 20, 2011 at 12:33 PM, Ishan Aggarwal
ishan.aggarwal.1...@gmail.com wrote:
You are given two 32-bit numbers, N and M, and two bit
U can use single walker (from 0 till 31) to convert integers N and M into
array of bits, then
another walker from i to j to replace values.
for(k=31;k=0;k++)
{
N[k]=n 01;
M[k]=m 01;
n=1;
m=1;
}
for(k=i;k=j;k++)
N[k]=M[k];
On Tue, Sep 20, 2011 at 12:44 PM, abhinav gupta
guptaabhinav
yup i too think so..Dats y I need to discuss this qs wid u.
On Tue, Sep 20, 2011 at 12:36 PM, Tamanna Afroze afroze...@gmail.comwrote:
@abhinav I think time complexity will be higher for that algorithm
--
You received this message because you are subscribed to the Google Groups
Algorithm
Its because o/p should look like dat.Bt dats simple you can do it
by multiplying bits to power(2, i) and
adding all expressions.Simple!
On Tue, Sep 20, 2011 at 1:09 PM, abhinav gupta guptaabhinav...@gmail.comwrote
In the first loop bits are added into the array N and M .I have taken two
You can parse the array to find address of max element
then you can parse second time leaving that particular address to find
second largest element.
On Tue, Sep 20, 2011 at 12:36 PM, surender sanke surend...@gmail.comwrote:
based on minmax in minimum number of comparisons..
struct pa
{
to k =0?
On Tue, Sep 20, 2011 at 12:50 PM, abhinav gupta guptaabhinav...@gmail.com
wrote:
U can use single walker (from 0 till 31) to convert integers N and M into
array of bits, then
another walker from i to j to replace values.
for(k=31;k=0;k++)
{
N[k]=n 01;
M[k]=m 01;
n=1;
m=1
You can also solve the problem by using bit operators. by using| !
.
Need sm thinking in dat..No time rite nw!
On Tue, Sep 20, 2011 at 1:12 PM, abhinav gupta guptaabhinav...@gmail.comwrote:
Its because o/p should look like dat.Bt dats simple you can do it
by multiplying bits to power(2, i
;
On Sep 20, 3:43 pm, abhinav gupta guptaabhinav...@gmail.com wrote:
You can also solve the problem by using bit operators. by using
| !
.
Need sm thinking in dat..No time rite nw!
On Tue, Sep 20, 2011 at 1:12 PM, abhinav gupta
guptaabhinav...@gmail.comwrote
What are the values of n and m you are providing???
On Tue, Sep 20, 2011 at 7:02 PM, deependra dsdeependraprat...@gmail.comwrote:
long int n,m;
cinnm;
long int a[n][m];
a[0][0]=1;
for(long int i=1;in;i++)
a[i][0]=0;
Beacuse memory requird to store (1000 * 1000) bytes is more than stack can
hold for the program..Dats y its giving segmentation fault...
On Tue, Sep 20, 2011 at 7:29 AM, Deependra pratap singh
dsdeependraprat...@gmail.com wrote:
for n1000 , m1000... m getting the fault. but lesser than that
stfu !
On Tue, Sep 20, 2011 at 10:27 AM, prasanth n nprasnt...@gmail.com wrote:
In the classic problem of the Towers of Hanoi, you have 3 rods and N disks
of different sizes which can slide onto any tower. The puzzle starts with
disks sorted in ascending order of size from top to bottom
for that u have rand() function in c programming just go through it
On Mon, Sep 19, 2011 at 8:42 PM, prasanth n nprasnt...@gmail.com wrote:
@don:
suppose if give like random(5)- it must give any number between 0 and 5..
On Mon, Sep 19, 2011 at 8:22 PM, Don dondod...@gmail.com wrote:
You
int i;
i=random(5);
int random(int x)
{
return (rand(x) % 5);
}
rand() is inbuilt function in c/c++;
On Mon, Sep 19, 2011 at 9:24 PM, Don dondod...@gmail.com wrote:
The most common way that it works would be that random(n) returns the
equivalent of a random integer mod n, so 0=xn. But
@Tammana can u pls give me the logic of the above code !
On Tue, Sep 20, 2011 at 8:35 AM, Tamanna Afroze afroze...@gmail.com wrote:
I don't know whether my one is good algorithm or not, but it gives somewhat
good output. It is in Java.
/*
* To change this template, choose Tools |
@yogesh :ya u right.
On Sat, Sep 17, 2011 at 11:58 AM, sukran dhawan sukrandha...@gmail.comwrote:
x== 9 is not an error !!! it simply returns a non zero value if its true
and 0 if its false
On Sat, Sep 17, 2011 at 11:39 AM, praveen raj praveen0...@gmail.comwrote:
This will show syntax
Above expression will be
(p^3+q^3+r^3)/pqr
if a+b+c=0, then a^3+b^3+c^3 = 3abc
so,
3pqr/pqr=3
On Thu, Sep 15, 2011 at 10:59 AM, rahul sharma rahul23111...@gmail.comwrote:
hw?
On Thu, Sep 15, 2011 at 10:57 AM, Tamanna Afroze afroze...@gmail.comwrote:
yah the ans is 3
--
You
Shut up...its 3,,
On Thu, Sep 15, 2011 at 9:43 AM, Don dondod...@gmail.com wrote:
It might be 3, but it doesn't have to be 3.
Don
On Sep 14, 11:56 pm, NAGARAJAN SIVARAMAN naga4...@gmail.com wrote:
if P+Q+R= 0 then P2 /QR + Q2/PR + R2/PQ = ??
how to solve this??
--
You received
u cnt divide a number by 0..that thing is self undrstod
On Thu, Sep 15, 2011 at 9:49 AM, Piyush Grover piyush4u.iit...@gmail.comwrote:
Don is right
if R = 0, P = 1 and Q = -1 then the given expression is UNDEFINED!!!
On Thu, Sep 15, 2011 at 10:16 PM, abhinav gupta guptaabhinav
dude dats outside the domain of the qs...dont be oversmart.
On Thu, Sep 15, 2011 at 9:49 AM, Don dondod...@gmail.com wrote:
No, not at all. Here is a trivial counterexample:
P = Q = R = 0
Don
On Sep 15, 11:46 am, abhinav gupta guptaabhinav...@gmail.com wrote:
Shut up...its 3
y u all r worried abt MS...open up ur own cmpny...
On Thu, Sep 15, 2011 at 10:13 AM, vivek goel vivek.thapar2...@gmail.comwrote:
hey ankur.
wat's eligibility criteria..
and eligible branches...
*mca* is eligible ??.
--
You
Runtime error.. x pointing to unintialised memory..and then initialised,,,
On Thu, Sep 15, 2011 at 11:02 AM, SAMMM somnath.nit...@gmail.com wrote:
#includecstdio
#includeiostream
using namespace std;
int main()
{
int w=10;
int *p=w;
int *x;
*x=1000;
int *y;
*y=100;
printf(%d
Runtime error
On Thu, Sep 15, 2011 at 11:16 AM, SAMMM somnath.nit...@gmail.com wrote:
OK Now try this ...
#includecstdio
#includeiostream
using namespace std;
int main()
{
int w=10;
int *p=w;
int *x;
*x=1000;
printf(%d %d ,*x,*p);
return 0;
}
Wht is
I dont knw man wat d hell is dis?
On Thu, Sep 15, 2011 at 11:19 AM, SAMMM somnath.nit...@gmail.com wrote:
No check It once more in G++ Compiler
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
file not closed.
On Wed, Sep 14, 2011 at 5:56 PM, ravi maggon maggonr...@gmail.com wrote:
Something like this was asked in written test of Tally. We had to find the
cause why this program crased during run time.
File *f;
int count=0;
if(f=fopen(file.txt,r))
{
while(f.get()!=EOF)
Create a structure
with num,count(of num) and link
parse the array and create nodes (nodes are created with id=num).
when the no of nodes == 3 print the nodes data and count.
On Wed, Sep 14, 2011 at 5:13 PM, parag khanna khanna.para...@gmail.comwrote:
find the frequencies of each alphabet ...
Informatica sucks.I have topped in its offcampus written test still they din
call me.
On Wed, Sep 14, 2011 at 7:05 PM, ravi maggon maggonr...@gmail.com wrote:
In Thapar Criteria was
BE CSE and I think MCA was also eligible but for interviews only BE CSE
were shortlisted.
Package: 7.75
@siddharam:
i think the above example is isomorphic
because in isomopic we check for the degree of each node in one tree to the
corresponding degree of another tree is present or not .
like eg:-
p-q--r---s
is isomorphic with
a--b--c---d
On Thu, Sep
in my opinion developer profile is better than testing...one
On Thu, Sep 15, 2011 at 10:57 AM, rahul sharma rahul23111...@gmail.comwrote:
hey guys plz tell the difference b/w testing n develp. profile ??? n
joing i n testing profile has growth as much as in develpoer???plz
tell soon..?should
they'll ask question on mostly on c programming and O.S. on thread, process
concepts
On Tue, Sep 13, 2011 at 6:46 PM, sourabh jain sourabhjain...@gmail.comwrote:
if any one who have selected for samsung ,please tell me the type of
ques.that can be ask by tech interview..
--
NIT ALLAHABAD...
On Tue, Sep 13, 2011 at 7:45 PM, navneet kumar
kumarnavneet@gmail.comwrote:
which college??
On Tue, Sep 13, 2011 at 7:41 PM, abhinav gupta abhinav@gmail.comwrote:
any one plzz tell me what they will ask in written test...
and which type of question
First reverse the whole string then reverse the individual words .Simple !
On Mon, Sep 12, 2011 at 11:08 AM, guna sekaran vgun...@gmail.com wrote:
String Reverse:
input :
welcome to all
output:
all to welcome
--
You received this message because you are subscribed to the Google
a) 100
On Sat, Sep 10, 2011 at 12:40 AM, abhishek abhishek.ma...@gmail.com wrote:
(a)
#define f(g,g2) g##g2
int main()
{
int var12=100;
printf(%d,f(var,12));
getch();
}
what will be the output??
(b)
main()
{
int i=400,j-300;
printf(%d...%d);
}
(c)
void main()
{
temp2 is second largest element.
On Sat, Sep 10, 2011 at 8:00 AM, abhinav gupta guptaabhinav...@gmail.comwrote:
I can solve this problem in O(n)
i=0;
temp1=arr[0];
while(i != len)
{
if(arr[i] temp1)
{
temp2=temp1;
temp1=arr[i]
}
i++;
}
On Sat, Sep 10, 2011 at 7:42 AM, Dave
Oops ..no u hav to quicksort it.
On Sat, Sep 10, 2011 at 8:24 AM, Dave dave_and_da...@juno.com wrote:
@Abhinav: Does it work correctly on {1, 3, 2}, or, for that matter, on
any array where the second largest comes after the largest?
Dave
On Sep 10, 10:16 am, abhinav gupta guptaabhinav
, abhinav gupta
guptaabhinav...@gmail.comwrote:
Oops ..no u hav to quicksort it.
On Sat, Sep 10, 2011 at 8:24 AM, Dave dave_and_da...@juno.com wrote:
@Abhinav: Does it work correctly on {1, 3, 2}, or, for that matter, on
any array where the second largest comes after the largest?
Dave
On Sep
46 matches
Mail list logo