Re: [algogeeks] Removing space inplace

2012-08-04 Thread atul pandey
Here..
1. if continuous spaces are occurring even times- let 2n time then it
replaces every second space with '\b'(backspace)

2.   if continuous spaces are occurring even times- let 2n+1 time then for
first 2n spaces it replaces every second space with '\b'(backspace) and
last space gets replaced by '\a'(alert character).

So in this way reducing no of alert characters('\a')...and spaces are
removed by help of '\b' character...

On Thu, Aug 2, 2012 at 7:51 PM, Daksh Talwar dakshtal...@gmail.com wrote:

 ^ : I guess this is the only in-place method.
 It prevents the space from being printed.
 does not 'remove' it though ; just replaces with a bell sound !


 On Wed, Aug 1, 2012 at 11:12 PM, atul pandey atulpande...@gmail.comwrote:

 Geeks just look at this...correct me if i am wrong...!!

 int main()
 {
 char s[] = how  are  youfriends;
 int i=0;
  while(s[i] != '\0')
 {
 if(s[i] == ' '  s[i+1]==' ')
  { s[i+1] = '\b';  i++; }
 else if(s[i]== ' ') s[i]='\a';
  i++;
 }
 printf(%s\n, s);
 }

 On Wed, Aug 1, 2012 at 5:01 PM, atul anand atul.87fri...@gmail.comwrote:

 j=0;
 for i to len
if(str[i] != '   ' )
{
  str[j]=str[i];
   j++;
}
 end
 str[j]='\0';

 On Wed, Aug 1, 2012 at 10:08 AM, Sambhavna Singh 
 coolsambha...@gmail.com wrote:

 Please have a look at this :
 http://www.careercup.com/question?id=14433699utm_source=feedburnerutm_medium=emailutm_campaign=Feed%3A+Careercup+%28CareerCup%29

 What does inplace shifting imply here? Cant i keep 2 pointers and
 overwrite a non space character onto a space character and advance both
 pointers till one again hits a space character and other a non-space
 character? Does that violate the condition given in the question?

  --
 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.


  --
 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.




 --
 Thanks  Regards,
 * Atul Kumar Pandey*

  --
 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.




 --
 - - - - - - - - - - - -
 With Regards
 Daksh Talwar

 --
 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.




-- 
Thanks  Regards,
* Atul Kumar Pandey*

-- 
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.



Re: [algogeeks] national instruments on campus interview procedure

2012-08-04 Thread Arun Kindra
http://www.krishnabharadwaj.info/national-instruments/

-- 
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.



[algogeeks] Amazon CodeSprint

2012-08-04 Thread Navin Kumar
 Given the array of digits, you have to calculate the least positive 
integer value of the expression that could *NOT *have been received by you.
The binary operators possible are *, +, -, / and brackets possible are ( 
and ).  Note that / is an integer division i.e. 9/5 = 1. 
For ex- 6 6 4 4 the answer is 18

1 = 6 /6 + 4-4

2 = 6/6 + 4/4

3 = 6  +( 6/4) -4
 
4 = (6+6+4) / 4

……..

18 cannot be formed


-- 
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/-/cxnY9WEACTIJ.
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.



Re: [algogeeks] Amazon CodeSprint

2012-08-04 Thread Prem Krishna Chettri
Well, I donoo the TO cost Impact on this question. If we need to get the
solution within the given interview time , we can go for the permutation
approach.. i.e permute all the operators and calculate.

But the T(O) and S(O) is seriously jeopardize.

Anyone got better ones??

On Sat, Aug 4, 2012 at 8:03 PM, Navin Kumar navin.nit...@gmail.com wrote:

 Given the array of digits, you have to calculate the least positive
 integer value of the expression that could *NOT *have been received by
 you.
 The binary operators possible are *, +, -, / and brackets possible are (
 and ).  Note that / is an integer division i.e. 9/5 = 1.
 For ex- 6 6 4 4 the answer is 18

 1 = 6 /6 + 4-4

 2 = 6/6 + 4/4

 3 = 6  +( 6/4) -4

 4 = (6+6+4) / 4

 ……..

 18 cannot be formed


  --
 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/-/cxnY9WEACTIJ.
 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.


-- 
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.



Re: [algogeeks] Local Minima in Unsorted Array

2012-08-04 Thread Ashish Goel
can you give an example of what do you mean by Local minima?
From Dave's example, it looks like the minima of the whole array..

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Fri, Aug 3, 2012 at 10:32 PM, shady sinv...@gmail.com wrote:

 Hi,
 Can anyone tell how to find local minima in an unsorted array ?
 Recommended solution : O(log(n))

 Shady.

 --
 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.


-- 
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.