Re: [algogeeks] Adobe interiew question

2012-06-12 Thread Abhishek Goswami
we can handle exception handling through macro.
http://en.wikibooks.org/wiki/C_Programming/Error_handling


On Tue, Jun 12, 2012 at 9:47 PM, Anika Jain anika.jai...@gmail.com wrote:

 how can we implement exception handling in c?

 --
 Regards
 Anika Jain

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



Re: [algogeeks] MS: searching problem......help me out...

2012-06-03 Thread Abhishek Goswami
Hi,

I have  found two url which contain answer of your question some extent.

42bits.wordpress.com/2010/04/17/find-kth-minimum-in-a-unsorted-array/



http://www.medwelljournals.com/fulltext/?doi=rjasci.2011.70.75


On Sun, Jun 3, 2012 at 8:31 PM, abhinav gupta abhinav@gmail.com wrote:


   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 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] MS: searching problem......help me out...

2012-06-03 Thread Abhishek Goswami
Hi Rahul,
In the below url,They have mentioned the parallel searching. it means
divide array than search element from two point.
i.e  number of element is {48,23,10,32,5}  search 32.

divide array [0-2]  and [3-4]  range...  traverse the array from p[0] and p
[3]... till half of the loop.

I hope we can search element into log n ( need to look more just giving .2
cents)



http://www.medwelljournals.com/fulltext/?doi=rjasci.2011.70.75


On Sun, Jun 3, 2012 at 9:25 PM, Rahul Kumar Patle patlerahulku...@gmail.com
 wrote:

 @abhinav: if you want to search just 15 in log(n) time then you can use
 the concept of heap tree.. apply one round of heapification (not for all
 elements but just one time it will be complete in log(n) times), and you
 will need to swap elements but when you got element 15 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 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 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.


-- 
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] Re: String comparison

2012-04-18 Thread Abhishek Goswami
Thx for in detail description and some insight

On Wed, Apr 18, 2012 at 5:40 PM, Gene gene.ress...@gmail.com wrote:

 You can't solve a problem like this with only examples of .  A
 complete definition is necessary.  For example, what do you do with
 a1 ? 2b
 Report mismatch?
 What do you do with
 1 abc ? 2 2
 Do you report  or mismatch?
 Here is one of infinitely many complete definitions consistent with
 your examples:
 1. Split each string into lists of maximal tokens consisting of all
 decimal digits or all letters.  White space separates tokens but is
 otherwise ignored.  Anything other than digits, letters, and
 whitespace is counted as end of string.
 2. Call these lists A and B.  Compare them pairwise.  If Ai and Bi
 are
 both strings of letters, compare them lexically using UTF-8 order.
 If
 Ai and Bi are all digits, compare them numerically.  Continue until
 you find an inequality between a pair and report this immediately,
 ignoring the rest of the string.  If you find a pair with types
 (letters or digits) that don't match, or if one token list is shorter
 than the other, report nothing. Otherwise if you run out of pairs,
 report equal.
 Here is code that is probably pretty close to this definition.  Tasks
 like this are easier if you split them up into a token scanning step
 and a processing step. I've done that here.

 #include stdio.h
 #include ctype.h

 // Scanner return values.
 #define END 0
 #define DIGITS 1
 #define ALPHA 2

 // Find the start and end of the first token
 // beginning at *start, ignoring initial white space.
 int scan(char **start, char **end)
 {
  char *p = *start;
  while (isspace(*p)) ++p;
  if (isdigit(*p)) {
*start = p;
do ++p; while (isdigit(*p));
*end = p;
return DIGITS;
  }
  if (isalpha(*p)) {
*start = p;
do ++p; while (isalpha(*p));
 *end = p;
return ALPHA;
  }
  return END;
 }

 // Return the non-negative value of the string
 // starting at p and ending at the char before end.
 int int_value(char *p, char *end)
 {
  int x = 0;
   while (p != end)
x = 10 * x + (*p++ - '0');
  return x;
 }

 // Possible comparison values.
 #define LT -1
 #define EQ 0
 #define GT 1
 #define NOTHING 2

 // Compare the strings starting at xp and ending
 // one char before x_end where x is a or b.
 int string_compare(char *ap, char *a_end,
   char *bp, char *b_end)
 {
  while (ap  a_end  bp  b_end) {
 int diff = *ap++ - *bp++;
if (diff  0) return LT;
if (diff  0) return GT;
   }
  if (bp  b_end) return LT;
  if (ap  a_end) return GT;
  return EQ;
 }

 // Compare tokens in strings a and b.
 int compare(char *a, char *b)
 {
   char *a_end, *b_end;

  while (1)  {
int a_scan = scan(a, a_end);
int b_scan = scan(b, b_end);
 if (a_scan != b_scan) return NOTHING;
if (a_scan == END) return EQ;
if (a_scan == DIGITS) {
   int a_val = int_value(a, a_end);
  int b_val = int_value(b, b_end);
   if (a_val  b_val) return LT;
  if (a_val  b_val) return GT;
}
else if (a_scan == ALPHA) {
   int cmp = string_compare(a, a_end, b, b_end);
  if (cmp != EQ) return cmp;
}
a = a_end;
 b = b_end;
  }
 }

 int main(void)
 {
  char *s[] = {
a5, a11,
6xxx, 007asdf,
00042Q, 42s,
6   8, 006 9,
  };
  int i;
  for (i = 0; i  sizeof s / sizeof s[0]; i += 2) {
int cmp = compare(s[i], s[i + 1]);
printf(%s %c %s\n, s[i], =?[cmp + 1], s[i + 1]);
  }
  return 0;
 }


 On Apr 17, 11:46 pm, abhishek zeal.gosw...@gmail.com wrote:
  Hi,
 
  I need to compare string into following way. Can anyone provide me some
  insight or algorithm in c++.
 
For example:
 
   a5  a11- because 5 is less than 11
   6xxx  007asdf- because 6  7
   00042Q  42s  - because Q  s alphabetically
   6   8  006 9   - because 8  9
 
  Thx 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 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.



[algogeeks] string comparsion

2012-04-17 Thread Abhishek Goswami
Hi,

I need to compare string into following way. Can anyone provide me some
insight or algorithm in c++.

  For example:

 a5  a11- because 5 is less than 11
 6xxx  007asdf- because 6  7
 00042Q  42s  - because Q  s alphabetically
 6   8  006 9   - because 8  9



Thx 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 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] Sorting for large data

2012-01-14 Thread Abhishek Goswami
Hi,
Could any point out me any algorithm and program  if we need to sort to
large data
like 10 ^ 80 with memory constraint. Suppose you have minimum memory like 4
MB.

I am not sure that this algo discussed or not but i was not able to find in
this group.

Thanks
Abhishek

-- 
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] Re: Sorting for large data

2012-01-14 Thread Abhishek Goswami
@DAVE
hmm I am agree with you that we  will not have that much huge
data. This question came in my interview process and I was not able to
figure out the solution of this issue.So I thought to check this forum

On Sun, Jan 15, 2012 at 12:40 AM, Dave dave_and_da...@juno.com wrote:

 @Abhishek: Do you really mean 10 to the 80th power. I doubt if there
 is that much information in the world.

 Dave

 On Jan 14, 12:09 pm, Abhishek Goswami zeal.gosw...@gmail.com wrote:
  Hi,
  Could any point out me any algorithm and program  if we need to sort to
  large data
  like 10 ^ 80 with memory constraint. Suppose you have minimum memory
 like 4
  MB.
 
  I am not sure that this algo discussed or not but i was not able to find
 in
  this group.
 
  Thanks
  Abhishek

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



[algogeeks] Any book suggestion for Data structure and algo.

2011-12-17 Thread Abhishek Goswami


-- 
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] Any book suggestion for Data structure and algo.

2011-12-17 Thread Abhishek Goswami
Cool Rahul

On Sat, Dec 17, 2011 at 3:09 PM, Rahul raikra...@gmail.com wrote:

 Google this
 6.046

 You should not ask any more suggestion  till you complete the above

 On Sat, Dec 17, 2011 at 3:07 PM, Abhishek Goswami 
 zeal.gosw...@gmail.comwrote:


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


-- 
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] Any book suggestion for Data structure and algo.

2011-12-17 Thread Abhishek Goswami
ya Sure Thx bro

On Sat, Dec 17, 2011 at 3:15 PM, Rahul raikra...@gmail.com wrote:

 If you have time then Do a Google this
 www.algo-class.org


 On Sat, Dec 17, 2011 at 3:13 PM, Abhishek Goswami 
 zeal.gosw...@gmail.comwrote:

 Cool Rahul


 On Sat, Dec 17, 2011 at 3:09 PM, Rahul raikra...@gmail.com wrote:

 Google this
 6.046

 You should not ask any more suggestion  till you complete the above

 On Sat, Dec 17, 2011 at 3:07 PM, Abhishek Goswami 
 zeal.gosw...@gmail.com wrote:


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


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


-- 
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] Re: question

2011-09-22 Thread Abhishek Goswami
I have seen code and output but I think it should be 7965 am i right? if you
are looking for first largest

On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.com wrote:

 http://ideone.com/pmil8


 On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.com wrote:

 @kartik
 Is it right


 On Wed, Sep 21, 2011 at 10:24 PM, kartik sachan 
 kartik.sac...@gmail.comwrote:

 obivously it will be first largest 

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




 --
 *Anil  Arya,
 Computer Science *
 *Motilal Nehru National Institute of Technology,Allahabad .
 *





 --
 *Anil  Arya,
 Computer Science *
 *Motilal Nehru National Institute of Technology,Allahabad .
 *


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



[algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread Abhishek Goswami
Hi,
Can anyone have algorithm or program for convert word into number

Input.   Three hundred twenty three :  output 323

InputTwenty  :  output -20

-- 
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] Algorithm or Program for convert word into number

2011-06-11 Thread Abhishek Goswami
Can you bit descriptive..

On Sat, Jun 11, 2011 at 7:27 PM, rahul rai raikra...@gmail.com wrote:

 Count the number of spaces in the sentence. If the last word is
 {one/two .} the just do the calling on the speciab part of code
 printing the rest of sentence

 On 6/11/11, rahul rai raikra...@gmail.com wrote:
  I wonder if there is any practical use of this algorithm for real life
  implementation . . Please let me know where you caught this problem
 
  On 6/11/11, Abhishek Goswami zeal.gosw...@gmail.com wrote:
  Hi,
  Can anyone have algorithm or program for convert word into number
 
  Input.   Three hundred twenty three :  output 323
 
  InputTwenty  :  output -20
 
  --
  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.
 
 
 
 
  --
  Rahul
 


 --
 Rahul

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



Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread Abhishek Goswami
@I got one of my interview . I tried to solve this issue but could not
it...I did googling but could not help me much...

On Sun, Jun 12, 2011 at 12:26 AM, Abhishek Goswami
zeal.gosw...@gmail.comwrote:

 Can you bit descriptive..


 On Sat, Jun 11, 2011 at 7:27 PM, rahul rai raikra...@gmail.com wrote:

 Count the number of spaces in the sentence. If the last word is
 {one/two .} the just do the calling on the speciab part of code
 printing the rest of sentence

 On 6/11/11, rahul rai raikra...@gmail.com wrote:
  I wonder if there is any practical use of this algorithm for real life
  implementation . . Please let me know where you caught this problem
 
  On 6/11/11, Abhishek Goswami zeal.gosw...@gmail.com wrote:
  Hi,
  Can anyone have algorithm or program for convert word into number
 
  Input.   Three hundred twenty three :  output 323
 
  InputTwenty  :  output -20
 
  --
  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.
 
 
 
 
  --
  Rahul
 


 --
 Rahul

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



[algogeeks]

2011-06-01 Thread Abhishek Goswami
I am sure this question has come already but can anyone point me answer
again.

1.if user enter number 0 to 1. than what will we algorithum to
   determine duplicate number (Note : user can not enter more than
1 number)

2. if we have a number in the range of  [1...5] than we insert number
randomly into array. how will we arrange element in sorted order.

 Ex.  1 1 2 4 5 5 5 3 4

1 1 2 3  4 4 5 5

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

2011-06-01 Thread Abhishek Goswami
for second question explanation.

if you have array for 100 element a[100]. and you can enter element into
array from 1 to 5 range upto a[100].So you have array
a[100] which contain number from 1 to 5. what will be efficient algorithm
for arranging number in ascending order..
ex 1 2 5 5 5 3 4 1 1 upto a[100]

output : 1 1 1  2 3 4 5 5 5

@First question.
What will be time complexity. I believe it will be o(n^2) can it be
implemented in more efficient way..



On Wed, Jun 1, 2011 at 10:27 PM, Harshal hc4...@gmail.com wrote:

 the simplest way is to use a hashmap, or an array arr[1] and keep track
 of the number seen so far, eg. by making arr[num]=1, and checking while
 inserting new elements.
 second question is a bit unclear


 On Wed, Jun 1, 2011 at 10:04 PM, Abhishek Goswami 
 zeal.gosw...@gmail.comwrote:

 I am sure this question has come already but can anyone point me answer
 again.

 1.if user enter number 0 to 1. than what will we algorithum to
determine duplicate number (Note : user can not enter more than
 1 number)

 2. if we have a number in the range of  [1...5] than we insert number
 randomly into array. how will we arrange element in sorted order.

  Ex.  1 1 2 4 5 5 5 3 4

 1 1 2 3  4 4 5 5

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




 --
 Harshal Choudhary,
 III Year B.Tech CSE,
 NIT Surathkal, Karnataka, India.


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



Re: [algogeeks]

2011-05-08 Thread Abhishek Goswami
can u please explain me in descriptive manner

On Sat, May 7, 2011 at 2:31 PM, Amir hossein Shahriari 
amir.hossein.shahri...@gmail.com wrote:

 @venkatesan : im not sure about that! this problem is different

 but we can do it in O(n^2)
 the DP1 can be built done in O(n^2) as in abhijith's solution
 also the DP2 can be built in O(n^2) too. instead of counting the min # of
 palindrome strings that can make the range of [low,high]
 count how many palindromes can make the range [0,x]
 this makes the dp2 array linear and the overall running time quadratic

 int minCuts(int x)
 {
 if(isPalin(0,x)) return 0;
 if(dp2[x]!=-1) return dp2[x];
 int ans=1e9;
 for(int i=1;ihigh;i++)
 if (isPalin(i,x))
 ans=min(ans,1+minCuts(i-1));
 return dp2[x]=ans;
 }


 On Sat, May 7, 2011 at 12:41 PM, venkatesan B 
 venkat_b_engin...@yahoo.co.in wrote:

 problem like to find largest palindrome in the string
 so, in O(n) time complexity to find largest palindrome in the string


 --
 *From:* hary rathor harry.rat...@gmail.com
 *To:* algogeeks@googlegroups.com
 *Sent:* Saturday, 7 May 2011 10:33 AM
 *Subject:* Re: [algogeeks]

 @venkatesan

 now you give the algorithm ... of O(n)
  --
 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.


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



Re: [algogeeks] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-04-18 Thread Abhishek Goswami
can u please me also .. zeal_gosw...@yahoo.com

On Thu, Apr 14, 2011 at 11:50 AM, Himanshu Neema 
potential.himansh...@gmail.com wrote:

 Hi All ,
 Yesterday I received an email from Author that this is *violation of
 Intellectual Property Ownership* ,So kindly please delete pdfs  please
 remove all the sharing.

 Thanks Guys.
 Himanshu


 On Thu, Apr 14, 2011 at 10:52 AM, Harshal hc4...@gmail.com wrote:

 Thanks :)

 On Thu, Apr 14, 2011 at 9:59 AM, Rajeev Kumar 
 rajeevprasa...@gmail.comwrote:

 check this link:

 https://docs.google.com/viewer?a=vpid=explorerchrome=truesrcid=1B5ady61W_93zq0st5FQpvzj4d6wFCdM3Vl8YGSqRt0_NVFWh3SGkNU24hIb3hl=en

 If you have any problem in access,please inform me

 On Thu, Apr 14, 2011 at 1:04 AM, Abhishek Goswami 
 zeal.gosw...@gmail.com wrote:

 Hi,
 I tried to open this book in google docs and got message that file is
 not avaliable. does this file not available in google docs
 if yes , can anybody share this book again

 On Tue, Mar 22, 2011 at 10:41 PM, Himanshu Neema 
 potential.himansh...@gmail.com wrote:

 Turns out that I cant send file larger than 4 MB , please download it
 from here , let me know if you're still unable to download:


 http://dl.dropbox.com/u/2681370/Algorithms%2Bfor%2BInterviews%2B%28scan%2Bocr%29%20%281%29.pdf

 have fun !


 On Tue, Mar 22, 2011 at 10:21 PM, Himanshu Neema 
 potential.himansh...@gmail.com wrote:

 Enjoy :)


 On Tue, Mar 22, 2011 at 10:09 PM, Saravanan T 
 mail2sarava...@gmail.com wrote:

 ++


 On Tue, Mar 22, 2011 at 9:51 PM, Anurag atri 
 anu.anurag@gmail.com wrote:

 and me too :)


 On Tue, Mar 22, 2011 at 9:28 PM, Nikhil Mishra 
 mishra00...@gmail.com wrote:

 count me too


 On Tue, Mar 22, 2011 at 11:16 AM, kunal srivastav 
 kunal.shrivas...@gmail.com wrote:

 plz send it to me too

 On Tue, Mar 22, 2011 at 11:14 AM, D.N.Vishwakarma@IITR 
 deok...@gmail.com wrote:

 --

 *With Regards
 Deoki Nandan Vishwakarma
 IITR MCA
 Mathematics Department
 *

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




 --
 thezeitgeistmovement.com

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




 --
 Regards
 Anurag Atri

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



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




 --
 Thank You
 Rajeev Kumar

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




 --
 Harshal Choudhary,
 III Year B.Tech CSE,
 NIT Surathkal, Karnataka, India.

 People die young because god loves them so much, I

Re: [algogeeks] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-04-18 Thread Abhishek Goswami
I think we can share into email...that will not be any issue. :)


On Mon, Apr 18, 2011 at 10:07 PM, Abhishek Goswami
zeal.gosw...@gmail.comwrote:

 can u please me also .. zeal_gosw...@yahoo.com


 On Thu, Apr 14, 2011 at 11:50 AM, Himanshu Neema 
 potential.himansh...@gmail.com wrote:

 Hi All ,
 Yesterday I received an email from Author that this is *violation of
 Intellectual Property Ownership* ,So kindly please delete pdfs  please
 remove all the sharing.

 Thanks Guys.
 Himanshu


 On Thu, Apr 14, 2011 at 10:52 AM, Harshal hc4...@gmail.com wrote:

 Thanks :)

 On Thu, Apr 14, 2011 at 9:59 AM, Rajeev Kumar 
 rajeevprasa...@gmail.comwrote:

 check this link:

 https://docs.google.com/viewer?a=vpid=explorerchrome=truesrcid=1B5ady61W_93zq0st5FQpvzj4d6wFCdM3Vl8YGSqRt0_NVFWh3SGkNU24hIb3hl=en

 If you have any problem in access,please inform me

 On Thu, Apr 14, 2011 at 1:04 AM, Abhishek Goswami 
 zeal.gosw...@gmail.com wrote:

 Hi,
 I tried to open this book in google docs and got message that file is
 not avaliable. does this file not available in google docs
 if yes , can anybody share this book again

 On Tue, Mar 22, 2011 at 10:41 PM, Himanshu Neema 
 potential.himansh...@gmail.com wrote:

 Turns out that I cant send file larger than 4 MB , please download it
 from here , let me know if you're still unable to download:


 http://dl.dropbox.com/u/2681370/Algorithms%2Bfor%2BInterviews%2B%28scan%2Bocr%29%20%281%29.pdf

 have fun !


 On Tue, Mar 22, 2011 at 10:21 PM, Himanshu Neema 
 potential.himansh...@gmail.com wrote:

 Enjoy :)


 On Tue, Mar 22, 2011 at 10:09 PM, Saravanan T 
 mail2sarava...@gmail.com wrote:

 ++


 On Tue, Mar 22, 2011 at 9:51 PM, Anurag atri 
 anu.anurag@gmail.com wrote:

 and me too :)


 On Tue, Mar 22, 2011 at 9:28 PM, Nikhil Mishra 
 mishra00...@gmail.com wrote:

 count me too


 On Tue, Mar 22, 2011 at 11:16 AM, kunal srivastav 
 kunal.shrivas...@gmail.com wrote:

 plz send it to me too

 On Tue, Mar 22, 2011 at 11:14 AM, D.N.Vishwakarma@IITR 
 deok...@gmail.com wrote:

 --

 *With Regards
 Deoki Nandan Vishwakarma
 IITR MCA
 Mathematics Department
 *

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




 --
 thezeitgeistmovement.com

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




 --
 Regards
 Anurag Atri

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



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




 --
 Thank You
 Rajeev Kumar

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

Re: [algogeeks] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-03-22 Thread Abhishek Goswami
can you upload this file into google docs or attach this file. i tried to
download this file but did not get any success for
open this file
Thanks
Abhishek

On Tue, Mar 22, 2011 at 10:41 PM, Himanshu Neema 
potential.himansh...@gmail.com wrote:

 Turns out that I cant send file larger than 4 MB , please download it from
 here , let me know if you're still unable to download:


 http://dl.dropbox.com/u/2681370/Algorithms%2Bfor%2BInterviews%2B%28scan%2Bocr%29%20%281%29.pdf

 have fun !


 On Tue, Mar 22, 2011 at 10:21 PM, Himanshu Neema 
 potential.himansh...@gmail.com wrote:

 Enjoy :)


 On Tue, Mar 22, 2011 at 10:09 PM, Saravanan T 
 mail2sarava...@gmail.comwrote:

 ++


 On Tue, Mar 22, 2011 at 9:51 PM, Anurag atri 
 anu.anurag@gmail.comwrote:

 and me too :)


 On Tue, Mar 22, 2011 at 9:28 PM, Nikhil Mishra 
 mishra00...@gmail.comwrote:

 count me too


 On Tue, Mar 22, 2011 at 11:16 AM, kunal srivastav 
 kunal.shrivas...@gmail.com wrote:

 plz send it to me too

 On Tue, Mar 22, 2011 at 11:14 AM, D.N.Vishwakarma@IITR 
 deok...@gmail.com wrote:

 --

 *With Regards
 Deoki Nandan Vishwakarma
 IITR MCA
 Mathematics Department
 *

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




 --
 thezeitgeistmovement.com

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




 --
 Regards
 Anurag Atri

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



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



Re: [algogeeks] Interview questions for multithreading in Java

2011-03-08 Thread Abhishek Goswami
I think you can go some basic concept which help you. I have collected some
info about threading . hope so it will little bit
useful
http://www.cppcoffe.blogspot.com/


On Tue, Mar 8, 2011 at 9:35 PM, Abhishek Sharma jkabhishe...@gmail.comwrote:

 u can go through the following questions...not sure about the answers...:

 1) What are the two types of multitasking?

 Ans : 1.process-based

 2.Thread-based

 2) What are the two ways to create the thread?

 Ans : 1.by implementing Runnable

 2.by extending Thread

 3) What is the signature of the constructor of a thread class?

 Ans : Thread(Runnable threadob,String threadName)

 4) What are all the methods available in the Runnable Interface?

 Ans : run()

 5) What is the data type for the method isAlive() and this method is

 available in which class?

 Ans : boolean, Thread

 6) What are all the methods available in the Thread class?

 Ans : 1.isAlive()

 2.join()

 3.resume()

 4.suspend()

 5.stop()

 6.start()

 7.sleep()

 8.destroy()

 7) What are all the methods used for Inter Thread communication and what is
 the class in which these methods are defined?

 Ans :1. wait(),notify()  notifyall()

 2. Object class

 8) What is the mechanisam defind by java for the Resources to be used by
 only one Thread at a time?

 Ans : Synchronisation

 9) What is the procedure to own the moniter by many threads?

 Ans : not possible

 10) What is the unit for 1000 in the below statement?

 ob.sleep(1000)

 Ans : long milliseconds

 11) What is the data type for the parameter of the sleep() method?

 Ans : long

 12) What are all the values for the following level?

 max-priority

 min-priority

 normal-priority

 Ans : 10,1,5

 13) What is the method available for setting the priority?

 Ans : setPriority()

 14) What is the default thread at the time of starting the program?

 Ans : main thread

 15) The word synchronized can be used with only a method.

 True/ False

 Ans : False

 16) Which priority Thread can prompt the lower primary Thread?

 Ans : Higher Priority

 17) How many threads at a time can access a monitor?

 Ans : one

 18) What are all the four states associated in the thread?

 Ans : 1. new 2. runnable 3. blocked 4. dead

 19) The suspend()method is used to teriminate a thread?

 True /False

 Ans : False

 20) The run() method should necessary exists in clases created as subclass
 of thread?

 True /False

 Ans : True

 21) When two threads are waiting on each other and can't proceed the
 programe is said to be in a deadlock?

 True/False

 Ans : True

 22) Which method waits for the thread to die ?

 Ans : join() method

 23) Which of the following is true?

 1) wait(),notify(),notifyall() are defined as final  can be called only
 from with in a synchronized method

 2) Among wait(),notify(),notifyall() the wait() method only throws
 IOException

 3) wait(),notify(),notifyall()  sleep() are methods of object class

 1
 2
 3
 1 amp; 2
 1,2  3
 Ans : D
 24) Garbage collector thread belongs to which priority?

 Ans : low-priority

 25) What is meant by timeslicing or time sharing?

 Ans : Timeslicing is the method of allocating CPU time to individual
 threads in a priority schedule.

 26) What is meant by daemon thread? In java runtime, what is it's role?

 Ans : Daemon thread is a low priority thread which runs intermittently in
 the background doing the garbage collection operation for the java runtime
 system


 On Tue, Mar 8, 2011 at 9:16 PM, Abhishek Sharma jkabhishe...@gmail.comwrote:

 what do u mean by multi-threading :P


 On Tue, Mar 8, 2011 at 7:37 PM, vaibhav agrawal agrvaib...@gmail.comwrote:

 Hi,

 What interview questions one would expect for multi-threading?

 Thanks,
 Vaibhav

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


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

2010-12-11 Thread Abhishek Goswami
Is it any puzzle

On 11 Dec 2010 16:07, parth panchal parthpancha...@gmail.com wrote:

how are you

-- 
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 group, send email to
algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@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.