hash would be a perfect choice.
I make a MinMaxHash class which would keep track of the min and max
value of the key.(since in this case we would never remove a key, thus
this primitive approach works. Otherwise use treeMap)
class MinMaxHash extends HashMap{
private Integer min = Integer.MAX_
stack for sure..
pop out the enteries till they r same and push this entry back once.
On Wed, Feb 16, 2011 at 11:18 AM, jalaj jaiswal
wrote:
> can any1 tell me the question .. m gettin half of the post ,...
>
> On Wed, Feb 16, 2011 at 10:41 AM, Jammy wrote:
>
>> @Abhijit. Does your code takes O
can any1 tell me the question .. m gettin half of the post ,...
On Wed, Feb 16, 2011 at 10:41 AM, Jammy wrote:
> @Abhijit. Does your code takes O(N^2)? I think the following code
> would do it in O(N)
>
> iterate the string once:
>
> void remove(char *a){
>if(!a){
>
@Abhijit. Does your code takes O(N^2)? I think the following code
would do it in O(N)
iterate the string once:
void remove(char *a){
if(!a){
int i = 0, j = 1;
while(a[j]!='\0'){
if(i<0 || a[i]!=a[j]){
here is my approach.
shared variables : in, out
shared memory : buf[N]
writer
while(1)
{
while(in+1 % N ==out)
{ // waiting
}
buf[in+1]= input;
in = in+1 % N
}
reader
while(1)
{
while(out == in)
{ // waiting
}
output = buf[out]
out = out+1 % N
}
On Tue, Feb
The solution is..
_AX = 10;
can anyone explain??
--
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...@googl
nice solution
--
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 opt
void change()
{
#define i i=10,n
}
this will do..
On Tue, Feb 15, 2011 at 11:33 PM, Rel Guzman Apaza wrote:
> Nothing... 10 in base 5 = 5 in base 10.
>
> void change(){
> printf(""); //...?
> }
>
> 2011/2/15 Don
>
> A semicolon is valid in the middle of a line in C or C++.
>>
>> For i
Hello,
we like to invite you all to participate in Online Programming Contest
organized as a part of Daksh 2011, an international level Technical
festival of SASTRA University, Thanjavur, Tamilnadu
We have two competitions:
1) DOPE
Dope is a 6 hour ACM ICPC style algorithmic competition with team
Nothing... 10 in base 5 = 5 in base 10.
void change(){
printf(""); //...?
}
2011/2/15 Don
> A semicolon is valid in the middle of a line in C or C++.
>
> For instance, no one says that
>
> for(i = 0; i < 10; ++i)
>
> is three lines of code.
>
> Don
>
> On Feb 15, 11:31 am, jalaj jaiswal
Mike Johnson wrote:
> Plesae rite a program for me to find prime nummers. It should be recursive
> prorgram. What duz that mean?
> If u type a nummer like 10 it should say "1 is prime, 2 is prime, 3 is prime,
> 4 is not prime" up to 10.
> This iz not homewurk I just thout of it myself. Lol.
/* S
A semicolon is valid in the middle of a line in C or C++.
For instance, no one says that
for(i = 0; i < 10; ++i)
is three lines of code.
Don
On Feb 15, 11:31 am, jalaj jaiswal wrote:
> after termination of semicolon , that will be considered a separate line i
> guess
>
>
>
> On Tue, Feb 15, 2
after termination of semicolon , that will be considered a separate line i
guess
On Tue, Feb 15, 2011 at 10:59 PM, Don wrote:
> void change()
> {
> printf("10"); while(1) {}
> }
>
> On Feb 15, 10:17 am, Balaji S wrote:
> > Insert only one line in the function change() so that the output of the
void change()
{
printf("10"); while(1) {}
}
On Feb 15, 10:17 am, Balaji S wrote:
> Insert only one line in the function change() so that the output of the
> program is 10.
> You are not allowed to use exit(). You are not allowed to edit the function
> main() or to
> pass the parameter to change
give an example as what to do .. tha language of the question is not clear
to me
On Tue, Feb 15, 2011 at 5:32 PM, bittu wrote:
> Given a byte array, in which characters can be 1 byte or 2 bytes long
>
> For 1-byte characters, the Most significant bit must be 0. For a 2-
> byte character, the mos
as i see this would need synchronization...
anyone tried it so far?
Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send em
Insert only one line in the function change() so that the output of the
program is 10.
You are not allowed to use exit(). You are not allowed to edit the function
main() or to
pass the parameter to change()
void change()
{
// Code here
}
int main()
{
int i=5;
change();
printf(“%d” ,i);
return 0;
the idea is to check how far the imagination can go
Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algog
Given a byte array, in which characters can be 1 byte or 2 bytes long
For 1-byte characters, the Most significant bit must be 0. For a 2-
byte character, the most significant bit of the most significant byte
must be one and the most significant bit of the least significant byte
is don’t care (X).
@Akshata
I managed to get AC with majority algorithm.
suggestions:
1) You can try to read input and find candidate in same loop
2) Use scanf and printf
Thanks,
Balaji.
On Tue, Feb 15, 2011 at 4:30 PM, jai gupta wrote:
> #include
> #include
> #include
> void work() {
> int n,max,maxpos,x,
#include
#include
#include
void work() {
int n,max,maxpos,x,i;
scanf("%d",&n);
int *arr=(int*) malloc(sizeof(int)*2005);
memset(arr,0,2005);
max=maxpos=0;
for(i=0;imax)
{
max=arr[x+1000];
maxpos=x;
}
}
if(max>n/2)
print
CALL FOR PAPERS
and
Call For Workshop/Session Proposals
CGVR'11
The 2011 International Conference on Computer Graphics
and Virtual Reality
Date and Location: Ju
got it clear.. thanks guys.
On Tue, Feb 15, 2011 at 1:46 PM, jagannath prasad das
wrote:
> here start is pointing to string constant which is created in read-only
> memory which can't be changed.so modifying it in the for loop causes
> segmentation fault
> declare it as a array type
>
>
> On Tue,
---
SUDHIR MISHRA wants to stay in better touch using some of Google's coolest new
products.
If you already have Gmail or Google Talk, visit:
http://mail.google.com/mail/b-62d5befb93-3fceb99bf3-oYX-pec-NCYCzMLIBV7yRJ6EMUI
You'll
Hi all,
I would like to invite you all to participate in Bytecode 2011, a
6-hour ACM ICPC style algorithm intensive online programming
competition. Bytecode is organized as a part of Pragyan 2011, the
International Level Techno-Managerial Festival of National Institute
of Technology, Tiruchirap
here start is pointing to string constant which is created in read-only
memory which can't be changed.so modifying it in the for loop causes
segmentation fault
declare it as a array type
On Tue, Feb 15, 2011 at 12:36 PM, rahul wrote:
> char *start is const char *start, pointer to const char, u c
26 matches
Mail list logo