and stop receiving emails from it, send an
email to algogeeks+unsubscr...@googlegroups.com.
--
Regards,
Ankur Khurana
Software Developer Engineer,
Microsoft India Development Center,
Hyderabad.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group
to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group
this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed
..:(
On Sun, Aug 14, 2011 at 9:46 AM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
My 2 cents,
When the termination signal is sent to the thread either synchronously or
asynchronously , you just have a mechanism in place that if that thread is
in critical section , it exits from
];
On Sun, Aug 14, 2011 at 9:57 AM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
it's a simple dp , ned not be knapsack one.
int arr[n];
arr[0]=0
arr[1]=1;
for(int i=2;i=n;i++)
{
arr[i]=arr[i-1]+arr[i-2];
}
do you get the code ? i mean , pseudo code was almost similar.
On Sun, Aug 14
@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received
I think thats the way radix sort will work...
Correct me if i m wrong...!
On 8/14/11, Ankur Khurana ankur.kkhur...@gmail.com wrote:
isn't it a simple question of applying radix sort from most significant
to
least signigicant digit and concatenating all the sorted numbers to get
cases. Will require extremely good use
of pointers.
On 14 August 2011 19:16, Ankur Khurana ankur.kkhur...@gmail.com wrote:
why will 678 come after 583 ?
okay ., sort from least to most significant digit. append imaginary 0's
at the end of the numbers with varying length to make them of same
://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
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 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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute
this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group
@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur
to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
to print from 10 to 7 in the row number 4. here prev will be 6.
On Sun, Aug 14, 2011 at 10:05 AM, AASHISH SUMAN
aashish.barn...@gmail.comwrote:
@ankur
what is the need of
prev=((i-)*i)/2;
On Sun, Aug 14, 2011 at 9:51 AM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
see , we can see
@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received
@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received
this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
at
this result as well.
Regards,
Ankur Khurana
--
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
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute
above is when the sorted array is in increasing order.
On Sat, Jul 30, 2011 at 11:56 AM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
low =lower_bound , high=upper_bound;
int a=arr[low];
while(lowhigh)
{
mid=(low+high)/2;
if( arr[mid]a midupper_bound arr[mid+1] a)
break; //you found
options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur
this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed
.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm
to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received
options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
Please explain the output, that why is it in that form in hexadecimal form
#includestdio.h
int main()
{
printf(%d %x,-11,-11);
return 0;
}
output :
-2 fffe
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
@rajeev: your code gives compilation error.
On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
no ,
n[0] is *(n+0)
so actually n is being dereferenced here .Check the basci diff
p is a pointer , but n is a pointer to a pointer.
On Fri, Jul 29, 2011 at 11:34 PM
http://ideone.com/OaCDR
On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty rajeevr...@gmail.comwrote:
@ankur :which compiler are u using??
On Fri, Jul 29, 2011 at 11:39 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
@rajeev: your code gives compilation error.
On Fri, Jul 29, 2011
from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you
...@gmail.comwrote:
@ankur: But the same above code wont show any error on my gcc 4.3.2
running on Open Suse 11.4
On Fri, Jul 29, 2011 at 11:48 PM, Ankur Khurana ankur.kkhur...@gmail.com
wrote:
http://ideone.com/OaCDR
On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty
rajeevr
i figured it out. I didnt know before that is was in 2's complement form .
On Fri, Jul 29, 2011 at 11:53 PM, sukhmeet singh sukhmeet2...@gmail.comwrote:
I couldn't understand the problem .. u have used %x as indentifier that why
it is so
On Fri, Jul 29, 2011 at 11:37 PM, Ankur Khurana
...@gmail.comwrote:
@ankur: But the same above code wont show any error on my gcc 4.3.2 running
on Open Suse 11.4
On Fri, Jul 29, 2011 at 11:48 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
http://ideone.com/OaCDR
On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty rajeevr...@gmail.com
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
code...for eg in dis ques only can u tell me how to use itoa to get sum...
On Sat, Jul 30, 2011 at 1:13 AM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
when you use itoa , what you get is a string. get the sum of all the
digits , using c-'0' and then use repeated subtraction . . .
On Sat
this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed
/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
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
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
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
if i declare a string constant inside another function
like let us say
,
int how()
{
char *s=hello;
return s;
}
so when how() get executed , the memory for hello will remain reserved or it
can be allocated to others. Will it amount to memory leak ?
--
Ankur Khurana
Computer Science
Netaji
#includeiostream
#includestring.h
using namespace std;
#define N(e) e#e
int main()
{
int i=1,j=2,k=3;
int m = i++ || j++ k++;
couti j k m;
}
output :-2 2 3 1
http://www.ideone.com/0sKBr
can anybody explain ? why are ++j and ++k are not evaluating even though
operator should be evaluated
than it wont check for the second.Thus j and k are not
getting evaluated.
On Tue, Jul 26, 2011 at 2:46 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
#includeiostream
#includestring.h
using namespace std;
#define N(e) e#e
int main()
{
int i=1,j=2,k=3;
int m = i++ || j++ k
email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute
, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
traverse the list and while updating u do value+min... still it is not
suitable if the magnitude is high.
On Sat, Jul 23, 2011 at 9:45 AM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
n logn merge sort.count sort only when range is known.
On Sat, Jul 23, 2011 at 1:35 AM
.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi.
--
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
.
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas
Sorry , solution nahi dekha tha tera maine.
On Thu, Jul 21, 2011 at 9:29 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
I gave an O(N) solution in a different thread by same author for this
question...
On Thu, Jul 21, 2011 at 6:08 PM, Abhi abhi123khat...@gmail.com wrote:
My
but mine was different , check kar liyo
On Thu, Jul 21, 2011 at 10:06 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
Sorry , solution nahi dekha tha tera maine.
On Thu, Jul 21, 2011 at 9:29 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
I gave an O(N) solution in a different
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science , 4th year
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group
, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer Science
Netaji Subhas Institute Of Technology
Delhi
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 group at
http://groups.google.com/group/algogeeks?hl=en.
--
Ankur Khurana
Computer
Can we do this ?
int i=12;
free(i);
Regards,
Ankur Khurana
Computer Science , 4th year
Netaji Subhas Institute Of Technology
Delhi.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
more generally what is the memory structure of local , global and runtime
allocated variable . I guess , runtime allocation is done from memory heap ,
local goes in to a stack . What about global ?
On Sun, Jul 17, 2011 at 2:57 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
Can we do
also go to the
stack.That's how they retain their values during function calls.
On Sun, Jul 17, 2011 at 3:02 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
more generally what is the memory structure of local , global and runtime
allocated variable . I guess , runtime allocation is done from
it will give.
On Sun, Jul 17, 2011 at 3:09 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
local stack is different and global is different ? and runtime memory is
going to memory heap that i know.
Saurabh : above snippet does not give runtime error.
On Sun, Jul 17, 2011 at 3:04 PM, saurabh
answer for first should be
2 22 23
and for second
2 222
2
correct me if i am wrong.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul
I am using MinGW compiler (codeblocks , out put is 788 and not 678 . Its
compiler dependent so , let us leave it that way only.
On Sat, Jul 16, 2011 at 3:27 PM, shiv narayan narayan.shiv...@gmail.comwrote:
according to me it processing is done from righ to left .first right
most a would
Use divide and conquer. take 2 array at a time and .so you are merging two
array at a time.
num_of_list=m;
length of list=n;
while(num_of_list 1)
{
while( (num of list where length = length_of_list) 2)
{
merge two lists of length (length_of_list);
}
if(num_of_list %2==0)
num_of_list/=2;
else
oops , didnt see the unsorted thing. complexity is mnlog(n) + mn log(m)
On Sat, Jul 16, 2011 at 4:23 PM, sagar pareek sagarpar...@gmail.com wrote:
sort all the arrays first O(nlogn)
then use merge sort
On Sat, Jul 16, 2011 at 3:43 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
Use
you sort array before merging. and then use merge sort
On Sat, Jul 16, 2011 at 6:53 PM, noobcoder ase.as...@gmail.com wrote:
how does ur algo produce sorted elements in final array?
On Jul 16, 3:55 pm, Ankur Khurana ankur.kkhur...@gmail.com wrote:
oops , didnt see the unsorted thing
if we are using strncpy( destination , source , num_of_char)
then if destination have less space allocated than num_of_char , what will
happen ?
Also , if there is no null char after string, what will happen , puts(str)
//where str is the string wihtout NULL character . I was not able to find
problem ka link bhi diya karo ya code..
On Sun, Mar 20, 2011 at 3:34 AM, sunny sunny.verma...@gmail.com wrote:
hello frnds...
i am getting TLE in 12th test case ..
can anyone over ther help me to shorten it..
#includestdio.h
#includeiostream
using namespace std;
int gcd(int a, int
@utraksh : 10^9 is well in int limits
On Tue, Mar 15, 2011 at 12:56 PM, Satyam Kapoor satyamkapoo...@gmail.comwrote:
@utkarsh:teri kismat acchi thi aur kuch nhimaze kar!
---
Satyam Kapoor
B.Tech-2nd Year
MNNIT-Allahabad.
--
You received this message because
@carl : may be this : https://www.spoj.pl/problems/SBSTR1/
On Tue, Mar 15, 2011 at 9:35 PM, kumar anurag anurag.it.jo...@gmail.comwrote:
I used a prgram of c which converts brainfuck program to C progaram which u
can compile using gcc
On Tue, Mar 15, 2011 at 9:12 PM, Carl Barton
https://www.spoj.pl/problems/MAXSUMSQ/
Hi in above problem , i am getting TLE but according to given contraints ,
i think my code is good enough to run. Can any body help me here
#include vector
#include map
#include algorithm
#include cstring
#include iostream
#include cstdio
#include cmath
may be this will do
int arr[21];
int *a;
a=arr+10;
now a can vary from a[-10] to a[10]
I have doubts but will this work ?
On Thu, Mar 10, 2011 at 3:31 PM, amit amitthecoo...@gmail.com wrote:
Indexing of an array starts with '0' by default. can we manually start
with 1 or any other number say
simply use GOTO
On Tue, Mar 1, 2011 at 3:40 PM, vaibhav shukla vaibhav200...@gmail.comwrote:
write printf statemen 100 times. lolzzz
On Tue, Mar 1, 2011 at 2:01 PM, Subhransu
subhransu.panigr...@gmail.comwrote:
Hey Guys,
@preetikatyagi : The question is pretty straight Write a
What is your primary purpose . If you want to make a game , OpenGL and
AllegroGL is way to go .Other wiase to make appliations , you can use visual
c++. Can you be more specific ?
Regards,
Ankur
On Sat, Feb 26, 2011 at 1:22 PM, Logic King crazy.logic.k...@gmail.comwrote:
I also want to know
try lazy propogation
On Tue, Feb 8, 2011 at 8:14 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:
Hey thanks for your help
I have written a code using range trees but I am still getting TLE [?][?][?]
Please suggest me something
Here is my code
/*
* File: main1.c
* Author: gs
*
*
somebody might enlighten for 3rd year as well (INDIA)
On Sun, Jan 9, 2011 at 6:53 PM, abhishesh srivastava
abhishesh.srivast...@gmail.com wrote:
Can anyone please tell me about the summer internship programs of various
institute.
I want to know how to register and about various summer
in a C++ program ,
when we have something like this
double p=37.0;
int k;
k=(int)p;
why is k!=p ?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this
not always. well , i got some problem using that approachwhen the output is
coming out of some library function , this doesn't qualify always i wlll
find an example by tomorrow.
On Thu, Jan 6, 2011 at 11:48 PM, juver++ avpostni...@gmail.com wrote:
On my computer k == p.
--
You received this
will an o(n^2) do ? , i have one in mind but will that suffice ?
anyways , here it goes
make array
a[array_length][2];
a[k][0] and a[k][1] will contain the no. of 0's and 1 till kth position.
just iterate twice to see where
a[i][0]-a[j][0]==a[i][1]-a[j][1]
can be maximized . meanwhile i am
it's exactly the same question as Buttons on codechef. search this forum ,
it have been discussed before
On Tue, Jan 4, 2011 at 4:13 PM, bittu shashank7andr...@gmail.com wrote:
There is a lock which is an N by N grid of switches. Each switch can
be in one of two states (on/off). The lock is
...@gmail.com
wrote:
Sum up all the number and divide by 2
Using the algorithm subset problem to find a number close to median
Wladimir Araujo Tavares
Federal University of CearĂ¡
On Wed, Dec 29, 2010 at 2:07 PM, Ankur Khurana ankur.kkhur...@gmail.com
wrote:
How will you divide and array
are we given range of numbers ?
On Sun, Dec 26, 2010 at 4:39 PM, bittu shashank7andr...@gmail.com wrote:
You are provided with a stream of numbers, design a data structure to
store the numbers in the stream along with their no. of occurrences.
Regards
Shashank Mani
--
You received this
i think if it given , can we consider a hash table ?
On Sun, Dec 26, 2010 at 4:39 PM, Ankur Khurana ankur.kkhur...@gmail.com wrote:
are we given range of numbers ?
On Sun, Dec 26, 2010 at 4:39 PM, bittu shashank7andr...@gmail.com wrote:
You are provided with a stream of numbers, design a data
may be we can assume that klog(n)
else i dont see a way out than hashing , because that is the only
thing less that log(n).
On Sun, Dec 26, 2010 at 6:37 PM, mohit ranjan shoonya.mo...@gmail.com wrote:
hmm..
ok let me try to explain my point...
suppose in stream, the rate is 1 integer/k time,
i have devised another apporah for same but i would have liked to
understand what terence has said ?
On Sat, Dec 25, 2010 at 3:01 PM, Ankur ankur.kkhur...@gmail.com wrote:
when you are talking abt starting from 1 that means that array is 1
based , right ?
and how did you get the steps
I have solved this problem , but i need test cases for this as it it
giving WA in online judge. i dont want algo , but if anyone have
solved this, please provide with some random test cases or one or two
corner test cases.
i will be greatful.
http://www.codechef.com/problems/ARRAYTRM
Given n
you can use direct c++ tem-plates. anyways ,
in c format. use strstr() to find the pointer to the substring
present in the main given string. then just shift all the contents
after the subtring to the starting of your substring.
On Thu, Dec 23, 2010 at 3:47 AM, Ajay Kumar ajay...@gmail.com
it is just like 0/1 knapsack problem with maximum weight of knapsack
as 40. but in this case that is minimum that we have to calculate.
calculate marks/time for every element . then try finding the elements
with max value/time to fulfill the quota of marks. i dont know if this
can be done in O(n)
:08 PM, Ankur Khurana ankur.kkhur...@gmail.com
wrote:
it is just like 0/1 knapsack problem with maximum weight of knapsack
as 40. but in this case that is minimum that we have to calculate.
calculate marks/time for every element . then try finding the elements
with max value/time to fulfill
i will try to elaborate or rewrite tat part
On Thu, Dec 23, 2010 at 10:25 PM, Ankur Khurana
ankur.kkhur...@gmail.com wrote:
wverything i mentioned above can be done in O(n) but sorting part is
nlogn . so that is what i was saying. can you specify where i was not
clear ?
On Thu, Dec 23, 2010
not exceeding (Total
Score - Pass Score), while maximize the sum of time of the subset.
So I do not think O(nlogn) greedy algorithm will solve this problem.
On 2010-12-23 23:38, Ankur Khurana wrote:
it is just like 0/1 knapsack problem with maximum weight of knapsack
as 40. but in this case
@snehal : nothing wrong in what saurabh said. it was just that if you
are posting a question , then you should also post the approach you
have thought.plus you are posting in bulk . so , please whenever you
give a question , also mention your approach. it gives greater
confidence in question to be
.
On Wed, Dec 22, 2010 at 10:04 PM, Ankur Khurana ankur.kkhur...@gmail.com
wrote:
@snehal : nothing wrong in what saurabh said. it was just that if you
are posting a question , then you should also post the approach you
have thought.plus you are posting in bulk . so , please whenever you
saurabh , asking for a better sol. is not a crime. rest everybody is
intelligent.
On Wed, Dec 22, 2010 at 10:27 PM, Saurabh Koar saurabhkoar...@gmail.com wrote:
@Snehal: I hv no problem wid ur doubts.Bt sometimes u post probs which
r very basic.As u solved the looping prob in other thread I
insertion sort in IMHO
On Tue, Dec 21, 2010 at 5:44 PM, bittu shashank7andr...@gmail.com wrote:
Which one is the efficient sorting technique for arranging the books
in a library?
a) Bubble Sort
b) Selection Sort
c) Insertion Sort
d) Heap Sort
Regards
Shashank
--
You received this
ashish , nobody is fighting here , but are u sure you are clear on
your probability concepts ? independent events do multiply .
what is the probability that when we toss three coins , we get all three heads ?
On Tue, Dec 21, 2010 at 6:45 PM, Ashish Goel ashg...@gmail.com wrote:
Dear Shashank
...@gmail.com wrote:
this is not probability purely...there is an else in between :)
why don't you write the program and test it out yourself :)
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Tue, Dec 21, 2010 at 6:52 PM, Ankur Khurana ankur.kkhur
1 - 100 of 117 matches
Mail list logo