Given an undirected graph G = (V, E), for any subset of nodes S ⊆ V we can
construct a graph Gs from G by removing all nodes in S together with their
incident edges. In the critical node problem (CNP), we are given an integer
1 ≤ k ≤ |V | and need to find a subset S of size k such that the graph
Hello All,
I need to know about amazon online test, has anyone given that?
How many and what type of questions they ask? Time period anything?
Thanking you
*Cheers
Raghav Garg
--
+91-9013201944*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Hi Shubham,
This may be because your final data type you have chosen for your output
is float, n the one which you are trying to print is of int data type (i.e. %d).
Suggestion : Try changing %d to %f and see whether it works for you or not?
Thanks Regards,
Pratts
On 01-Mar-2013, at 1:11,
The output of the below code is also zero ,
key reason is floating point number are stored as *mantissa, exponent. *
float dec=1.00;
printf(\n dec=%d , float =%f,dec,dec);
On Fri, Mar 1, 2013 at 12:05 PM, Karthikeyan V.B kartmu...@gmail.comwrote:
O/p will not be 0.
1.00 is the result
on my system every time o/p is 0
using ubuntu 10.04 ,gcc compiler
On Mon, Mar 4, 2013 at 7:34 AM, rohit jangid rohit.nsi...@gmail.com wrote:
output for me for the previous snippet
localhost:slingshot rohitjangid$ ./a.out
1799476872
1799474584
localhost:slingshot rohitjangid$ ./a.out
yup , it is showing
0
0
on ideone as well . so my gcc compiler is i686-apple-darwin11-llvm-gcc-4.2.
that can be the reason . from here it appears 0 is just a coincidence and
it depends on compiler implementation . C doesn't define any such behavior.
On Mon, Mar 4, 2013 at 3:45 PM, Shubham
Ya, its looking like the problem of 'i686-apple-darwin11-llvm-gcc-4.2'.
For me as well it shows different outputs.
On Mon, Mar 4, 2013 at 4:45 PM, rohit jangid rohit.nsi...@gmail.com wrote:
yup , it is showing
0
0
on ideone as well . so my gcc compiler
is i686-apple-darwin11-llvm-gcc-4.2.
yeah true . one interesting thing I noticed is that if you run this code
#includestdio.h
int main()
{
int i = 0;
do {
printf (%d\n,(float)1);
}while(i++ 1);
return 0;
}
one would expect same output in both the rows but surprisingly it came
different for me every time .
output for me for the previous snippet
localhost:slingshot rohitjangid$ ./a.out
1799476872
1799474584
localhost:slingshot rohitjangid$ ./a.out
1710327432
1710325144
localhost:slingshot rohitjangid$ ./a.out
1856128648
1856126360
localhost:slingshot rohitjangid$ ./a.out
1724065416
1724063128
On
code snippet:
*int main()
{
printf (%d\n,(float)((int)(3.5/2)));
return 0;
}*
--
Regards,
SHUBHAM SANDEEP
IT 3rd yr.
NIT ALD.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it,
I think this is because of type mismatch. You are enforcing your program to
read a floating point number in the way of reading a integer. And they have
totally different format. If you have -Wall turned on, you should see a
warning.
Yanan Cao
On Thu, Feb 28, 2013 at 1:41 PM, Shubham Sandeep
thank you for pointing out that format was the key point.
On Fri, Mar 1, 2013 at 1:19 AM, gmagog...@gmail.com gmagog...@gmail.comwrote:
I think this is because of type mismatch. You are enforcing your program
to read a floating point number in the way of reading a integer. And they
have
O/p will not be 0.
1.00 is the result which when read as %d takes the decimal value of
float 1.00 stored in memory - it will not be 1.00 or 0.
Since float is not stored as direct binary in memory as integer is stored,
instead there's a separate procedure for storing float as binary
www.ams.jhu.edu/~castello/362/Handouts/*hungarian*.pdf
This PDF might be helpful
On Sunday, 16 September 2012 16:42:25 UTC+5:30, Rahul Kumar Patle wrote:
@atul: in Hungarian Algorithms works for minimization of cost where the
terminating condition is based on zeros.. in my problem what
we can assign minimum possible value, like negative infinity to the
diagonal elements.
Then they would not be considered for maximizing the sum.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
@tushar :- correct...
On Sun, Sep 16, 2012 at 12:59 PM, Tushar tushicom...@gmail.com wrote:
we can assign minimum possible value, like negative infinity to the
diagonal elements.
Then they would not be considered for maximizing the sum.
--
You received this message because you are
@atul: in Hungarian Algorithms works for minimization of cost where the
terminating condition is based on zeros.. in my problem what value i will
have to consider as base/terminating values because there may not be same
values in coloumn and rows..
second thing you use subtraction there, here will
make all mat[i][j] to -ve sign and make mat[i][j]=INT_MAX
now i guess same algo will work..no changes required.
On Sun, Sep 16, 2012 at 4:42 PM, Rahul Kumar Patle
patlerahulku...@gmail.com wrote:
@atul: in Hungarian Algorithms works for minimization of cost where the
terminating condition is
typo error :-
mat[ i ] [ j ] to -ve sign and make mat[ i ][ i ]=INT_MAX
On Mon, Sep 17, 2012 at 9:43 AM, atul anand atul.87fri...@gmail.com wrote:
make all mat[i][j] to -ve sign and make mat[i][j]=INT_MAX
now i guess same algo will work..no changes required.
On Sun, Sep 16, 2012 at 4:42 PM,
A 2D array of order A[N][N] is given, considering entry A[i][i] as invalid
you have to select one element from each row such that
1. Selected elements does not belong to same column.
2. Sum of selected element has maximal.
--
Thanks and Regards:
Rahul Kumar
correct me if i am wrong ,
it seems similar to Hungarian algorithm.
here each column can be considered as persons P(p0,p1,p2,..pn) and each as
cost of job say X(x0,x1,x2,x3,x4xn).
Hungarian algorithm tells how to find minimal but here its maximal...so i
guess changes in the algo will give the
typo error :-
and each *row* *as cost
On Sun, Sep 16, 2012 at 12:44 AM, atul anand atul.87fri...@gmail.comwrote:
correct me if i am wrong ,
it seems similar to Hungarian algorithm.
here each column can be considered as persons P(p0,p1,p2,..pn) and each as
cost of job say
@atul
agreed with u dat it can be solved through hungarian method.. but what
about the condition a[i][i] entry is invalid
if all elements lie on diagonal n d sum is also maximum den a[i][i]
condition will be violated but Hungarian method still works
--
You received this message because you are
any one given Amzon online test recently?
Plz share quetions and interview experience.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from
Can you please tell the kind of algos that will be asked for the interview
and what all subjects to focus for?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
The next solve the problem of eight Queeen... but i don't undestand
it!!! can you explain me?
(defun n-queens (n m)
(
if (= n 1)
(loop for x from 1 to m collect (list x))
(loop for sol in (n-queens (1- n) m) nconc
(loop for col from 1 to m when
(loop for row
The next code, it's about the problem Eight Queens, i found it in internet,
but i'm new in LISP and i don´t know how to compile it...
Can you help me?
(defun find-queen (arr p d)
(destructuring-bind ((px py) (dx dy)) (list p d)
(do ((x px (+ x dx))
(y py (+ y dy)))
((not
Hi I have one year experience and have interview scheduled on monday.
Pease help me with your experience or knowledge regarding questions,
strategy and
any misc aspect.
Thanks in advance
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
Plz put the technical written paper pattern ...of sourcebit... and some
sample papers...of what type of questions(level) would be asked...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
can anybody tell me about INFOEDGE working culture?
--
Shubham bansal
contact no. 7206338328
NIT Kurukshetra
Computer Engineering
(Final year)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
http://www.fileserve.com/file/eBgSThF/How%20To%20Prepare%20For%20Qt%20Apt%20For%20Cat%202E%20By%20Sharma.pdf
On Tue, Sep 27, 2011 at 4:23 AM, SHUBHAM BANSAL
shubham.bans...@gmail.comwrote:
If anyone have E-book of Quantative Aptitude For CAT by Arun Sharma.??
Then kindly send to my email.or
for 1st
#includeiostream
#includevector
using namespace std;
int main()
{
char c;
string s;
int n;
vector char ans;
cins;
int i=0;
while(s[i]!='\0')
{
c=s[i];
n=s[i+1]-'0';
while(n--)
ans.push_back(c);
i+=2;
}
2nd
#includeiostream
#includevector
using namespace std;
int main()
{
string s;
cins;
int i=0,count=1;
vectorint no;
vectorchar c;
while(s[i]!='\0')
{
if(s[i]==s[i+1])
count++;
else
{
c.push_back(s[i]);
i found a question of ms earlier but know i not able to find
it.plz post link or thread
i/p::a3b2c4:
o/p:aaabb
i/p:aaabbc
o/p:a3b2c1
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
for 2nd one
#includeiostream
#includeconio.h
using namespace std;
int main()
{
char str[100];
cinstr;
char ch=str[0];
int count=0,i=0;
while(str[i])
{
if(str[i]==ch)
count++;
else
{
for 1st
#includeiostream
#includeconio.h
#includestring.h
using namespace std;
int main()
{
char str[100];
cinstr;
int len=strlen(str);
int i=1;
while(ilen)
{
int x=str[i]-48;
while(x--)
coutstr[i-1];
i+=2;
Can anyone tell me some suggestions to prepare for Pep exam...?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
RS Agrawal is an author. Title of the book would have been more precise.
On Tue, Sep 13, 2011 at 10:45 AM, sanil gandhi...
sanil.gandh...@gmail.comwrote:
R.S.Agrawal
--
Regards,
Sanil Gandhi.
9423851845.
--
You received this message because you are subscribed to the Google
please suggest me some good aptitude books
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
R.S.Agrawal
--
Regards,
Sanil Gandhi.
9423851845.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
sscanf is similar to scanf except that input is read from string rather than
keyboard or i/o
*c -supression character.it reads character and discards it.doesnt store it
anywhere
On Tue, Aug 30, 2011 at 9:32 PM, Mani Bharathi manibharat...@gmail.comwrote:
char*str=11/1/1999;
only year gets scanned here, * suppresses assignment of day and month.
Sanju
:)
On Tue, Aug 30, 2011 at 9:08 AM, sukran dhawan sukrandha...@gmail.comwrote:
sscanf is similar to scanf except that input is read from string rather
than keyboard or i/o
*c -supression character.it reads
i don think so.can u brief it ?
On Tue, Aug 30, 2011 at 10:45 PM, Sanjay Rajpal srn...@gmail.com wrote:
only year gets scanned here, * suppresses assignment of day and month.
Sanju
:)
On Tue, Aug 30, 2011 at 9:08 AM, sukran dhawan sukrandha...@gmail.comwrote:
sscanf is similar to scanf
but sanjay in the ques it is *c*cd
shudn't there be a % before that ??
On Tue, Aug 30, 2011 at 11:22 PM, Sanjay Rajpal srn...@gmail.com wrote:
Run the following program :
main()
{
int a,b;
scanf(%d %*d,a,b);
printf(\na= %d, b=%d,a,b);
}
now see the values of a and b, and post the
yes conversion specifier missing i think
On Tue, Aug 30, 2011 at 11:37 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote:
but sanjay in the ques it is *c*cd
shudn't there be a % before that ??
On Tue, Aug 30, 2011 at 11:22 PM, Sanjay Rajpal srn...@gmail.com wrote:
Run the following program
yes % has to be there.
Sanju
:)
On Tue, Aug 30, 2011 at 11:12 AM, sukran dhawan sukrandha...@gmail.comwrote:
yes conversion specifier missing i think
On Tue, Aug 30, 2011 at 11:37 PM, SANDEEP CHUGH
sandeep.aa...@gmail.comwrote:
but sanjay in the ques it is *c*cd
shudn't there be a %
so what should be the correct question after writing % specifier.
On Tue, Aug 30, 2011 at 11:48 PM, Sanjay Rajpal srn...@gmail.com wrote:
yes % has to be there.
Sanju
:)
On Tue, Aug 30, 2011 at 11:12 AM, sukran dhawan sukrandha...@gmail.comwrote:
yes conversion specifier missing i
Hi folks !
I am able to clear the aptitude round of placement but i will
not be called for the second interview round in the first interview round
they will not ask much questions and what ever they wil ask i will answer
dem correctly only . This has happened with me twice!! i am
h
can ny suggest me some link for
1. compiler contruction
2. Web OS construction
nd suggest some good final year projects...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Yogesh. Web OS is dead. Leave it and Move on...
Compiler construction is a cool thing to learn though.
For final year project, first find a good organization where you can do a
project. use your contacts. then find out what kind of projects are
available in that organization/IT company.
we have to do final year project in colg itself.
intership project is another thing. I hv done that.
so ,any links frm where i can get detail for compiler contruction
or web crawler
plz suggest
--
You received this message because you are subscribed to the Google Groups
Algorithm
ORACLE COMING TO OUR COLLEGE FOR TRAINING...
CAN ANYONE FROM THIS GROUP TELL ME ABOUT HOW TO PREPARE FOR THAT?
I WILL BE REALLY THANKFUL TO THAT PERSON..
PLEASE HELP ME..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
just search the groupyou'll find lots of questions
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
http://gplus.to/amolsharma99
http://twitter.com/amolsharma99http://in.linkedin.com/pub/amol-sharma/21/79b/507http://youtube.com/amolsharma99
On Sat,
I m a CSE student
Plz suggest me sum final yr project
1. good project that help me learn
or
2.that solve sum real lyf situation means projects that are needed to make
thngs easy for others
do post ur suggestion
--
You received this message because you are subscribed to the Google Groups
On 20 August 2011 21:09, Yogesh Bhati ybha...@gmail.com wrote:
I m a CSE student
Plz suggest me sum final yr project
1. good project that help me learn
or
2.that solve sum real lyf situation means projects that are needed to make
thngs easy for others
do post ur suggestion
what is your
area of interest :
1.web related koi application
2.database
3.core programming
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
how about a webOS ? (it involves all 3 ;-) )
On 20 August 2011 21:22, Yogesh Bhati ybha...@gmail.com wrote:
area of interest :
1.web related koi application
2.database
3.core programming
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
4.ERP also
webos wat is it?? brief
is it related to *webOS* is a
proprietaryhttp://en.wikipedia.org/wiki/Proprietary_software
mobile operating
systemhttp://en.wikipedia.org/wiki/Mobile_operating_system running
on the Linux kernel http://en.wikipedia.org/wiki/Linux_kernel.
--
You received this
On 20 August 2011 21:33, Yogesh Bhati ybha...@gmail.com wrote:
4.ERP also
webos wat is it?? brief
is it related to *webOS* is a
proprietaryhttp://en.wikipedia.org/wiki/Proprietary_software
mobile operating
systemhttp://en.wikipedia.org/wiki/Mobile_operating_system running
on the Linux
thanx dude
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this
which code executes faster?
code1:- for(i=0;in;i++)
for(j=0;jn;j++)
large_array[i][j]=0;
code2:- for(j=0;jn;j++)
for(i=0;in;i++)
large_array[i][j]=0;
--
Regards,
Kamakshi
kamakshi...@gmail.com
--
You received this message because you are subscribed to the Google Groups
If the dimensions are same, both will execute equally fast.
On Mon, Aug 8, 2011 at 3:21 PM, Kamakshii Aggarwal
kamakshi...@gmail.com wrote:
which code executes faster?
code1:- for(i=0;in;i++)
for(j=0;jn;j++)
large_array[i][j]=0;
code2:- for(j=0;jn;j++)
for(i=0;in;i++)
Sorry, I was thinking something else.
Code 1 should be faster since arrays are stored in row-major fashion,
the entire row will fit in cache, and accessing sequentially in the
row would be faster because of higher cache hits than Code 2.
On Mon, Aug 8, 2011 at 3:25 PM, Gaurav Menghani
got it..thanks :)
On Mon, Aug 8, 2011 at 3:27 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:
Sorry, I was thinking something else.
Code 1 should be faster since arrays are stored in row-major fashion,
the entire row will fit in cache, and accessing sequentially in the
row would be
Both Will take same time.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/hwcTUmMW_zsJ.
To post to this group, send email to algogeeks@googlegroups.com.
@gaurav: are u sure?
On Mon, Aug 8, 2011 at 3:40 PM, Amir pkpat...@gmail.com wrote:
Both Will take same time.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
The principle of locality of reference suggests if a reference is made
to a memory location, next reference is close to it. So, it is a basic
assumption that processors fetch memory locations close to it, to
optimize fetch time. Since the array is stored in row-major form
AFAIK, elements in the
nice explanation gaurav
Thank you,
Siddharam
On Mon, Aug 8, 2011 at 5:17 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:
The principle of locality of reference suggests if a reference is made
to a memory location, next reference is close to it. So, it is a basic
assumption that
i have seen plenty of questions on string manipulation and bits
operations asked in various comcanies exams.
any one give me some good links where i can find some really good
tutorials on string manipulation.
--
You received this message because you are subscribed to the Google Groups
Hi folks!
If any of you have Thoughworks flow questions, Coding rounds
questions, Technical interview questions kindly please share. Thank
you.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Sorry for the typo, Its Thoughtworks
On Wed, Aug 3, 2011 at 11:04 PM, Reynald reynaldsus...@gmail.com wrote:
Hi folks!
If any of you have Thoughworks flow questions, Coding rounds
questions, Technical interview questions kindly please share. Thank
you.
--
You received this message
hi reynald i have send u some questions on the group
On Wed, Aug 3, 2011 at 10:36 AM, Reynald Suz reynaldsus...@gmail.comwrote:
Sorry for the typo, Its Thoughtworks
On Wed, Aug 3, 2011 at 11:04 PM, Reynald reynaldsus...@gmail.com wrote:
Hi folks!
If any of you have Thoughworks flow
the best way to identify recursion is when finding solution to a problem
consist of finding solution to a sub problem
ex-5!=5*(4!)=5*4*(3!).
for bits see topcoder tutorials on bitwise operators
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
thanks raj,
is this the bitwise operator tutorial that you told about ?
http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=bitManipulation
On Wed, Aug 3, 2011 at 3:48 PM, raj kumar megamonste...@gmail.com wrote:
the best way to identify recursion is when finding solution to a
Hi, i don't know how to use stringstream of STL, if i have the string
a=helloawordagoodabye, i need the next list:
hello
word good
bye
check that for each 'a' i need break the string...how
--
Victor Manuel Grijalva Altamirano
Universidad Tecnologica de La Mixteca
--
You received this
http://ideone.com/FtfQO
On Thu, Aug 4, 2011 at 2:54 AM, Victor Manuel Grijalva Altamirano
kavic1.mar...@gmail.com wrote:
Hi, i don't know how to use stringstream of STL, if i have the string
a=helloawordagoodabye, i need the next list:
hello
word good
bye
check that for each 'a' i need
thanks Pankaj, i learn some new today
--
Victor Manuel Grijalva Altamirano
Universidad Tecnologica de La Mixteca
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
nice code :)
On Thu, Aug 4, 2011 at 3:10 AM, Victor Manuel Grijalva Altamirano
kavic1.mar...@gmail.com wrote:
thanks Pankaj, i learn some new today
--
Victor Manuel Grijalva Altamirano
Universidad Tecnologica de La Mixteca
--
You received this message because you are subscribed to
even this is a gud 1.
http://www.cprogramming.com/tutorial/bitwise_operators.html
Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering
On Thu, Aug 4, 2011 at 1:35 AM, Samba Ganapavarapu sambasiv...@gmail.comwrote:
thanks raj,
is this the bitwise operator tutorial that
Write a program that accepts an input integer n, and calculates the
number and sum of all the numbers between 1 and n (inclusive) that are
NOT evenly divisible by ANY of the first 5 prime numbers (2,3,5,7,11).
The program should print out a clearly labeled count and sum
my code is : it is not
This is the solution to the MST problem
m getting WA again n again... cant figure out where's the mistake...
so plzzz help!!!
https://www.spoj.pl/problems/BLINNET/
#includeiostream
#includestring
#includevector
#includelist
#includequeue
#define MAXINT (int)9e9
#define TR(a,it)
Clarification : The number (count) is the number of elements between 1 and n
which are not evenly divisible by 5 prime numbers
and the result is the sum of all the numbers between 1
and n which are not evenly divisible by 5 prime numbers . Right???
For Example : if n=5 then
val = 2*3*5*7*11
for(i = 0 to n-1)
if(val%a[i] == 0)
count++,sum+=a[i];
surender
On Tue, Jul 5, 2011 at 10:10 PM, Rajeev Bharshetty
rajeev.open.1...@gmail.com wrote:
Clarification : The number (count) is the number of elements between 1 and
n which are not evenly divisible by 5 prime
I think you are getting it wrong.
Surender, your solution says that numbers divisible by all of the first 5
prime numbers will be taken into account whereas the question says that only
the numbers *not* evenly divisible by *any* of the first 5 prime numbers are
to be added.
Shiv,
you are making
If my interpretation is right, following should be the code.
int main()
{
int userInteger = 0;
cout Enter A Number endl;
cin userInteger; // Ask For a number from the user
if (userInteger 0) // Is the number valid?
{
int result = 0;
int prime[5] = { 2, 3, 5, 7, 11 };
int a,b, count = 0;
the length of the rope is l units.
I can only cut any rope into two halves.
for example if the length of the rope is 8 and we need a length of
rope 6
we first cut into two halves and we get 4, 4
now we cut any of the half again and we get 4,2,2
now we can merge 4 and 2 and form a rope of length
i guess the no. of 1s in the binary representation of the number is the
answer..for 6 its 2...
On Sat, Jul 2, 2011 at 1:32 PM, cegprakash cegprak...@gmail.com wrote:
the length of the rope is l units.
I can only cut any rope into two halves.
for example if the length of the rope is 8 and we
yup :)
On Sat, Jul 2, 2011 at 1:38 PM, Shalini Sah shalinisah.luv4cod...@gmail.com
wrote:
i guess the no. of 1s in the binary representation of the number is the
answer..for 6 its 2...
On Sat, Jul 2, 2011 at 1:32 PM, cegprakash cegprak...@gmail.com wrote:
the length of the rope is l
(this is dependon on compiler implementaion)this is due to shortcircuit
implementaion of intermidiate code genaration phase of compiler..
please read Aho ullman book of compiler desgn to get more details.
On Wed, Jun 15, 2011 at 12:51 AM, snehi jain snehijai...@gmail.com wrote:
first
Hello friends I am thinking of a combinatorics solution to this
problem on spoj but cant come up wd a formula please suggest me some
technique to solve this problem
http://www.spoj.pl/problems/CHAIR/
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
What about precedence order then.
http://www.difranco.net/cop2220/op-prec.htm i mean acc. to precedence order
should be evaluated before || in the second exampleresult should be
k=1,j=3 and i= -2
On Mon, Jun 13, 2011 at 11:41 AM, udit sharma sharmaudit...@gmail.comwrote:
hmm. Sry yr...
anybody having idea about preference order ??
On Tue, Jun 14, 2011 at 4:20 AM, nicks crazy.logic.k...@gmail.com wrote:
What about precedence order then.
http://www.difranco.net/cop2220/op-prec.htm i mean acc. to precedence
order should be evaluated before || in the second
according to precedence
m= ++i || ++j ++k
will become
m = ++i || (++j ++k);NOT this m = (++i || ++j) ++k;
first i gets incremented and since that gives a non-zero value the rest of
the statement is not executed.
On Tue, Jun 14, 2011 at 8:41 PM, nicks
bt increment operator has the higher precedence than || and
so all the variables should be incremented first then and then ||
should be evaluated
then how it is happening.plz explain
rahul dixit
Du-Mca
--
You received this message because you are subscribed to the Google Groups
Algorithm
hmm...someone explain...me too confused :(
On Tue, Jun 14, 2011 at 9:14 AM, rahul dixit dixit.rahu...@gmail.comwrote:
bt increment operator has the higher precedence than || and
so all the variables should be incremented first then and then ||
should be evaluated
then how it is
that is what is happening here
m = ++i || (++j ++k);
in C if P = Q || R;
first it checks Q if that is NOT true then it computes C else it doesn't.
++ is a unary operator so before the || and operations can happen
increment will take place. This justifies the higher precedence of ++
first it checks Q if that is NOT true then it computes R else it doesn't.
this is the correct line .
On Tue, Jun 14, 2011 at 10:21 PM, snehi jain snehijai...@gmail.com wrote:
that is what is happening here
m = ++i || (++j ++k);
in C if P = Q || R;
first it checks Q if that is NOT
can sme body tell me..?
1)
#include stdio.h
int main()
{
int i= -3, j=2 ,k=0, m;
m= ++i ++j || ++k;
printf(%d %d %d %d\n,i,j,k,m);
return 0;
}
output:
-2 3 0 1
2)#include stdio.h
int main()
{
int i= -3, j=2 ,k=0, m;
m= ++i || ++j ++k;
printf(%d %d %d %d\n,i,j,k,m);
return 0;
}
the expression involving and and or operator is evaluated from left to right
uptill the point from where the value of the expression can be determined.
On Mon, Jun 13, 2011 at 6:17 PM, Shachindra A C sachindr...@gmail.comwrote:
|| and operators are called short circuit operators and need not
ok i got the values of i ,j ,k ,.in all the 3 codes but can u please
explain me how we get the value of m =1 in all the 3 program.?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
1 - 100 of 148 matches
Mail list logo