[algogeeks] Interns Required

2017-11-16 Thread Prateek Gupta
Hello all,

We at Mindtickle (Pune based) are looking to hire some interns having
interest and experience in *JS / frontend*. People having a break in next
two months would be very suitable, but others are also encouraged to reach
out. 6 months interns would be even better.

The work will be focusing mostly on JS / front end. You'd be required to
write production code in existing JS infra and develop some new modules.
This will be a great chance to learn from experienced people and get an
exposure in writing production grade applications.

If interested, reply to this email with following details :

- Duration available for work.
- College and Branch.

-- 
Prateek Gupta
MNNIT Allahabad.

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.


[algogeeks] Rocket Fuel

2015-01-17 Thread Prateek Khandelwal
Hey all
Is anyone ever get interviewed in Rocket Fuel ? Can someone please tell
what type of questions they have asked ?
Thanks
Prateek

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Re: [algogeeks] Re: Comparing string of unequal length

2014-10-07 Thread Prateek Khandelwal
Below is my code where s1 is larger and s2 is smaller

string paddedString(string s1, string s2){

  int min = INT32_MAX, t, star = 0, diff = int(s1.size() - s2.size());

  string result = "";

  for (int i = 0; i <= diff; i++) {

t = 0;

for (int j = i; j < s2.size(); j++) {

  if (s1[j] != s2[j]) {

t++;

  }

}

if (t < min) {

  min = t;

  star = i;

}

  }

  for (int i = 0; i < star; i++) {

result += "*";

  }

  result += s2;

  for (int i = 0; i < (diff - star); i++) {

result += "*";

  }

  return result;

}

Prateek Khandelwal
Software Engineer in Directi
+91-7042393719

On Wed, Oct 8, 2014 at 12:10 AM, Rishav Mishra 
wrote:

> Hi Vikas and Prateek,
>
> Vikas, the 'd' is arbitrary. The question is simply to return the padded
> string such that the number of similar characters in the padded smaller
> string (which is now equal in length to the bigger string) and the bigger
> string is the minimum.
>
> Prateek, I can understand the solution you mentioned- be great if you can
> send your code.
>
> However, I understand that the smaller string has to be moved (m-n) times
> and each time there are n comparisons. If anybody has any ideas for
> additional optimizations (even with lets say additional space complexity),
> it would be awesome to hear!
>
> On Tue, Oct 7, 2014 at 11:29 PM, Prateek Khandelwal 
> wrote:
>
>> Just think in this manner that put 0 star in front, then 1 star in front
>> and so on and while doing this just compare both the strings. If you are
>> not able to understand just tell me I will mail my code to you.
>>
>> Prateek Khandelwal
>> Software Engineer in Directi
>> +91-7042393719
>>
>> On Tue, Oct 7, 2014 at 11:23 PM, Prateek Khandelwal 
>> wrote:
>>
>>> I think this question can be done in O((m-n)*n) where m is the length of
>>> larger string and n is the length of smaller string
>>>
>>> Prateek Khandelwal
>>> Software Engineer in Directi
>>> +91-7042393719
>>>
>>> On Tue, Oct 7, 2014 at 6:06 PM, vikas 
>>> wrote:
>>>
>>>> question unclear ?What is to be minimize ?
>>>> in given example:
>>>> ca*d*bch
>>>> abc
>>>>
>>>> what is role of "d" ?
>>>>
>>>>
>>>> On Monday, 6 October 2014 22:52:10 UTC+5:30, Rishav wrote:
>>>>>
>>>>> Hi everyone,
>>>>>
>>>>> I was asked this question recently in an interview: Given two strings
>>>>> of unequal length, you have to pad the smaller string (either at the
>>>>> beginning or the end or both, no insertions allowed) with any character 
>>>>> you
>>>>> want. The idea is to minimize the index-wise non-similar elements in both
>>>>> the strings.
>>>>>
>>>>> Example:
>>>>> abc
>>>>> cadbch
>>>>>
>>>>> The character we want should be:
>>>>>
>>>>> **abc*, such that the difference is just one(b and c are same for both
>>>>> strings in this position). I only found a solution with O(mn) complexity.
>>>>> Anybody can suggest any optimizations?
>>>>>
>>>>  --
>>>> 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, send
>>>> an email to algogeeks+unsubscr...@googlegroups.com.
>>>>
>>>
>>>
>>  --
>> 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, send an
>> email to algogeeks+unsubscr...@googlegroups.com.
>>
>
>  --
> 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, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Re: [algogeeks] Re: Comparing string of unequal length

2014-10-07 Thread Prateek Khandelwal
Just think in this manner that put 0 star in front, then 1 star in front
and so on and while doing this just compare both the strings. If you are
not able to understand just tell me I will mail my code to you.

Prateek Khandelwal
Software Engineer in Directi
+91-7042393719

On Tue, Oct 7, 2014 at 11:23 PM, Prateek Khandelwal 
wrote:

> I think this question can be done in O((m-n)*n) where m is the length of
> larger string and n is the length of smaller string
>
> Prateek Khandelwal
> Software Engineer in Directi
> +91-7042393719
>
> On Tue, Oct 7, 2014 at 6:06 PM, vikas  wrote:
>
>> question unclear ?What is to be minimize ?
>> in given example:
>> ca*d*bch
>> abc
>>
>> what is role of "d" ?
>>
>>
>> On Monday, 6 October 2014 22:52:10 UTC+5:30, Rishav wrote:
>>>
>>> Hi everyone,
>>>
>>> I was asked this question recently in an interview: Given two strings of
>>> unequal length, you have to pad the smaller string (either at the beginning
>>> or the end or both, no insertions allowed) with any character you want. The
>>> idea is to minimize the index-wise non-similar elements in both the strings.
>>>
>>> Example:
>>> abc
>>> cadbch
>>>
>>> The character we want should be:
>>>
>>> **abc*, such that the difference is just one(b and c are same for both
>>> strings in this position). I only found a solution with O(mn) complexity.
>>> Anybody can suggest any optimizations?
>>>
>>  --
>> 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, send an
>> email to algogeeks+unsubscr...@googlegroups.com.
>>
>
>

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Re: [algogeeks] Re: Comparing string of unequal length

2014-10-07 Thread Prateek Khandelwal
I think this question can be done in O((m-n)*n) where m is the length of
larger string and n is the length of smaller string

Prateek Khandelwal
Software Engineer in Directi
+91-7042393719

On Tue, Oct 7, 2014 at 6:06 PM, vikas  wrote:

> question unclear ?What is to be minimize ?
> in given example:
> ca*d*bch
> abc
>
> what is role of "d" ?
>
>
> On Monday, 6 October 2014 22:52:10 UTC+5:30, Rishav wrote:
>>
>> Hi everyone,
>>
>> I was asked this question recently in an interview: Given two strings of
>> unequal length, you have to pad the smaller string (either at the beginning
>> or the end or both, no insertions allowed) with any character you want. The
>> idea is to minimize the index-wise non-similar elements in both the strings.
>>
>> Example:
>> abc
>> cadbch
>>
>> The character we want should be:
>>
>> **abc*, such that the difference is just one(b and c are same for both
>> strings in this position). I only found a solution with O(mn) complexity.
>> Anybody can suggest any optimizations?
>>
>  --
> 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, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Re: [algogeeks] Google Interview Question: In how many intervals does a number exists

2013-06-09 Thread Prateek Jain
2->2 as 2 lies in [2,3] and [1,4] ?


On Sun, Jun 9, 2013 at 12:50 PM, Monish Gupta wrote:

> There are n Intervals. Given a set of m numbers, tell in how many
> intervals does each number exists.
> Example: 4 Intervals: [2,3] [3,4] [1,4] [3,10]. Numbers {2,4,11}
> For 2 -> 1 as 2 lies only in 1 interval [2,3]
> For 4 -> 3 as 4 lies in 3 intervals
> For 11 -> 0 as 11 lies in none of the given 4 intervals.
>
> It can be easily done in O(m*n) by traversing n intervals for each number
> in the given set of m numbers. How would improve this?
>
> Note: I could not fully recall, but I have seen very similar question in
> codechef but could not find the same.
>
> --
> 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, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>
>
>

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.




Re: [algogeeks] stack. Mid element in o(1)

2013-05-23 Thread Prateek Jain
I think there is no need for such a complex code. use length() method to
get the size of the stack and return the middle element i.e.

m=S.length()
if(m is even)
return arr[m/2]

else
return arr[m+1/2]

it can be done in O(const) time


On Thu, May 23, 2013 at 12:54 PM, Avi Dullu  wrote:

> Code is here . Logic is made clear by
> the variable names. Idea is similar to the one which is used to build a
> queue using 2 stacks.
>
>
> On Wed, May 22, 2013 at 8:45 AM, MAC  wrote:
>
>> I think this is only possible if you make sure that at push you store the
>> middle element with the top element as well .. this would mean push would
>> cease to be o(1)   & become o(n) .. . or is there some other trick ?
>>
>
>
>
> Veni Vedi Slumber !
>
> --
> 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, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>
>
>

-- 
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, send an email 
to algogeeks+unsubscr...@googlegroups.com.




Re: [algogeeks] VIDEO STREAMING

2012-11-23 Thread Prateek Gupta
@kartik +1:P :P

PS : pardon the pun.


On Sat, Nov 24, 2012 at 11:42 AM, Kartik Sachan wrote:

>
> hey anybody has any idea about video streaming using vlcj lib ??
>
>
> --
>
> *WITH REGARDS,
>
> *KARTIK SACHAN
>  B.Tech. Final Year
> Computer Science And Engineering
> Motilal Nehru National Institute of Technology,Allahabad
> Phone No: +91-9451012943
> E-mail: kartik.sac...@gmail.com
>
>
>  --
>
>
>

-- 




[algogeeks] Re: Question asked in Amazon online test

2012-06-28 Thread Prateek Khurana
Hi,

This one is quite easy. You have to calculate the number of one's before 
every zero and add them up. That's it.

public class Test1 {

public void printArray(int[] tmpArr) {
for (int i : tmpArr) {
System.out.println(i);
}
}
 public int calculateMinSwaps(int[] tmpArr) {
int minSwaps = 0;
int numberOfOne = 0;
for (int i : tmpArr) {
if (i == 1) {
numberOfOne++;
} else {
minSwaps += numberOfOne;
}
}
return minSwaps;
}
 /**
 * @param args
 */
public static void main(String[] args) {
// TODO Auto-generated method stub
Test1 test1 = new Test1();
int[] minSwaps = {
1,1,1,0,0,0,1,0
};

// test1.printArray(minSwaps);
int minswap = test1.calculateMinSwaps(minSwaps);
System.out.println(minswap);
}

}


On Saturday, June 23, 2012 11:34:55 AM UTC+5:30, zerocool142 wrote:
>
> Given an array containing sequence of bits (0 or 1), you have to sort 
> this array in the ascending order i.e. all 0' in first part of array 
> followed by all 1's.   The constraints is that you can swap only the 
> adjacent elements in the array. Find the minimum number of swaps 
> required to sort the given input array. 
>
> Example:   Given the array (0,0,1,0,1,0,1,1) the minimum number of swaps 
> is 3. 
>

-- 
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/-/XDJ5a5YfykEJ.
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] Question asked in Tachyon interview

2012-06-26 Thread Prateek Jain
main(a,b,m)
02{
03while (~scanf("%d%d",&a,&b))
04{
05  m=0;
06  while (a)
07  {
08if (a&1)
09   m+=b;
10a>>=1;
11b<<=1;
12  }
13  printf("%d\n",m);
14}
15}

-- 
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] The following problem is a variation of "Tower of hanoi" problem...Plz suggest on how to approach the following problem...

2012-05-30 Thread Prateek Jain
built a tree (not binary) where the root node is the initial configuration
of pegs. For each possibility of movement of the initial configuration of
disks, a child node is created. Thus, for each child node created, I check
if the current configuration is the final configuration. If yes, problem
was solved and we are done =).  Otherwise its creates other child nodes of
the current node. Note that the verification of the current configuration
with the final configuration of the nodes  is done by breadth-first
search(this is the
secret of this solution to find the smallest number of moves).


If u need i can give u the JAVA code for this

-- 
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] problem with increment operator

2012-05-30 Thread Prateek Jain
okk

-- 
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] problem with increment operator

2012-05-29 Thread Prateek Jain
yups...it is compiler dependent...but a logic is necessary to get it...

-- 
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] problem with increment operator

2012-05-29 Thread Prateek Jain
how is it 6?
++a(5) + ++a(6) + a++(6) it shud be 17

-- 
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] Direct-I second round telephonic interview

2012-04-11 Thread Prateek Khandelwal
He asked me about my *projects* and technical background. So you should
know everything related to your projects.
*
Now my interview questions...*

1. What is the difference between *hasmap*, *bst* and *trie* ???
2. Compare *mergesort* and *quicksort* why in sort function of vectors
randomized quicksort is used 
3. What is *process* and what are* threads* and why there is need of
threads and what can't we use threads everywhere ??
4. How threads communicate with each other  (He want a *working
code*just of the part in which communication is happening between
thread)
5. What is *database indexing* ?? What are there types and how it works ???
6. What are the layers of* OSI* model and what are the protocols associated
with application layer ??
7. What is *DNS *and explain it working 

*SOLUTION   =  WIKIPEDIA*
>
> --
> 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/-/JwgaVxlIcj0J.
> 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] probability of winning with two cards

2012-01-18 Thread Prateek Jain
ya obviously...it is 1/3.no need of any data is required

On 1/18/12, sunny agrawal  wrote:
> isn't the answer will be 1/3, without any calculations :)
>
> On Thu, Jan 19, 2012 at 7:10 AM, Sundi  wrote:
>
>> there are 52 cards.. there are 3 players a1,a2,a3 each player is given
>> 2 cards each one of A=2...J=11,Q=12,K=13..a user wins if his sum of
>> cards is greater then the other two players sum.
>>
>> find the probability of a1 being the winner?
>>
>> --
>> 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.
>>
>>
>
>
> --
> Sunny Aggrawal
> B.Tech. V year,CSI
> Indian Institute Of Technology,Roorkee
>
> --
> 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: which is better?

2011-09-22 Thread Prateek Jain
depends on the requirement of the code...

On Thu, Sep 22, 2011 at 11:00 AM, DIPANKAR DUTTA  wrote:

> Depends on compiler architecture , and how they
> use instruction set architecture ( Increment Op) of underlining machine
>
> On Thu, Sep 22, 2011 at 7:21 AM, Don  wrote:
>
>> If the value of the expression is not being used, ++n is preferred.
>> Most coding standards used by big companies require the prefix
>> operator to be used unless the pre-incremented value is required.
>> Don
>>
>> On Sep 22, 7:54 am, Sahil Garg  wrote:
>> > n=n+1
>> >
>> > n++
>> >
>> > ++n
>> >
>> > which of the three is better ??
>> >
>> > Sahil Garg
>> > Computer Engg. DCE
>>
>> --
>> 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 and Regards,
> --
> **DIPANKAR DUTTA
> Software Development Engineer
> Xen Server - OpenStack Development Team (DataCenter and Cloud)
>
> Citrix R&D India Pvt Ltd
> 69/3, Millers Road, Bangalore – 560052
> Phone: +91 8147830733
> Office: Extn: 16429
> Email: dipankar.du...@citrix.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] Find the output

2011-09-16 Thread Prateek Jain
Brijesh is right.until u do the type casting it will show an error

On Fri, Sep 16, 2011 at 5:57 AM, Pradip Singh  wrote:

> it will print 2,5
>
> On Fri, Sep 16, 2011 at 2:35 AM, Brijesh wrote:
>
>>
>>>
>> On Friday, 16 September 2011 13:25:38 UTC+5:30, Anup wrote:
>>>
>>> #include
>>> int main()
>>> {
>>> int a[5]={1,2,3,4,5};
>>> int *ptr=(&a + 1);
>>>
>>int *ptr=(int *)(&a + 1);
>>
>>> printf("%d %d\n",*(a+1),*(ptr-1));
>>> return 0;
>>> }
>>>
>>> Find the output!
>>>
>>
>> Now it will print 2 5
>>
>> --
>> 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/-/4tXlbiojgm8J.
>>
>> 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] C output

2011-09-14 Thread PRATEEK VERMA
9 and 3

-- 
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: whats d problem wid using gets?

2011-09-07 Thread PRATEEK VERMA
@harshit
it is also possible with scanf("%[^\n]s") for multi word input

-- 
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] plz xplain the o/p

2011-09-06 Thread PRATEEK VERMA
@piyush
the output will hello piyushit's due to following reason
you've declared array of 2 pointers to character(char *pstr[2]),which means
hello and piyush are stored somewhere else but your array is having only
starting addresses of each string.now when you are calling swap
function you are passing these addresses as a copy to formal parameters t1
and t2...if you really want to see the change in main function then you have
to do call by reference.i.e. instead of sending copy of content of your
array of pointers,send the address of that location where your pointer is
stored in array of pointers(i.e. send addresses of pstr[0] and pstr[1]
instead of sending values of pstr[0] and pstr[1])...for this to
work,your function should be
swap(char** t1,char** t2){
char *t;
t=*t1;
*t1=*t2;
*t2=t;
}

if still there is problem then you need to revise concept of pointers...Let
Us C or pointer in C would help

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

2011-08-31 Thread PRATEEK VERMA
oh i'm sorry guys & galz,its my mistake..actually i forgot to add one
more field in struct
this is the correct one
typedef struct
{
int bit1:29;
int bit2:4;
}bit;
int main()
{
printf("%d\n",sizeof(bit));
return 0;
}

now what will be the output...i'm sure you will amazed to see the result
after changing bitfield of bit1 to 28.

-- 
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: How to save a binary search tree space efficiently

2011-08-30 Thread PRATEEK VERMA
level order traversal can be a solution but since it is BST that we want to
store not binary tree(we can store binary tree using level order trav and
can reconstruct tree out of it) so we can just store the preorder traversal,
at time of reconstructing,scan through this traversal and pass the parent
node to child to determine position of child wrt parentdo this for
all n nodes

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

2011-08-30 Thread PRATEEK VERMA
@kartik it's wrong output...output will be 8 bytes.I asked this question
just to give more clear picture of bit field

-- 
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] convert a string into another in minimum number of steps

2011-08-29 Thread PRATEEK VERMA
Anup has proposed good solution.use edit distance algorithm and
make matrix for insertion and deletion operation.
Last entry of the matrix will give the solution which says about minimum
possible operation to convert one string to other.

-- 
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: How to save a binary search tree space efficiently

2011-08-29 Thread PRATEEK VERMA
@prashant
it is the same mid value as u calculate in binary search i.e. (lowest
index+highest index)/2
No matter whether it is 18 or 27,u gonna get almost balanced BST every time
if u do construct the tree as ankit has mentioned.

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

2011-08-29 Thread PRATEEK VERMA
#define g(a) #a
replaces any occurrence of g(a) with string a.
#define f(a,b) a##b
replaces any occurrence of f(a,b) with concatenation of a and b

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

2011-08-28 Thread PRATEEK VERMA
@kartik
there is nothing to do as how computer stores the datasome may be
little endian or big endian.
only thing that matters here is how the bits are being accessed.
computer accesses the bits from left to right.
you can ensure by running the following code
main()
{
int r=456;
int *p;
p=&r;
printf("%d\n",*((char*)p));
}

one more thing

can u guess what will be output of
typedef struct
{
int bit1:32;
}bit;
int main()
{
printf("%d\n",sizeof(bit));
}
and why??

-- 
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] Re: Class Doubt

2011-08-28 Thread prateek gupta
In c++ we have default copy constructor ,which is called when we use
statement like e2=e;ie when object are of same class type.

On Aug 28, 3:29 pm, ravi maggon  wrote:
> Hi
> Can you explain the below mentioned code. As far as I know we need to
> overload = operator in order to equate object of a class and below code
> should give error. But it is running perfectly on gcc compiler. Please
> correct  me if I am wrong at some point.
>
> #include
> using namespace std;
>
> class emp
> {
>       public:
>              char *n;
>              int age;};
>
> int main ()
> {
>     emp e={"xyz",21};
>     emp e2;
>     e2=e;
>     printf("%d",e2.age);
>     system("pause");
>
> }
>
> --
>
> Regards
> Ravi Maggon

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

2011-08-28 Thread PRATEEK VERMA
int bit1:1;
above definition instructs compiler that use 1 bit for storing
integer(signed by default) in bit1.
Such notation is used for optimization of memory use.

So if someone stores 1 in bit1 then,it will be treated as -1 by compiler
since we have instructed the compiler to store it in one bit and since in
this case leftmost bit is 1 which will be treated as -1 by the system and
output will be -1.

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

2011-08-28 Thread PRATEEK VERMA
in c++,classes have some by default feature like they have default
constructor,copy constructor
and overloaded =operator by default

-- 
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] c program explain

2011-08-28 Thread PRATEEK VERMA
for(i=0;i<16;i++)
printf("%d\n",(num

Re: [algogeeks] elitmus test

2011-08-25 Thread prateek gupta
prepare well for di,
quant and va are easy but di is really hard.
1 ques that often appears in their test is
 ABC
 *   EFG
-
 7JK
   L4N
PQR
---
---
some conditions will be given and you have to find which number does a
particular character given in ques represents.
On Thu, Aug 25, 2011 at 9:49 AM, prasanna  wrote:

> Hi
> Whosoever have taken the elitmus test, pls share the type of questions
> asked in the test.
>
> --
> 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] Re: regarding amdocs interview questions

2011-08-16 Thread prateek gupta
@abhishek
yes i am appearing through offcampus drive.plz tell me regarding sql
and unix preparation as i belong to ECE and don't have good knowledge
of these subjects.

On Aug 16, 1:29 pm, abhishek  wrote:
> @ prateek
>
> r u appearing offcampus??? from which college u r?
> just brush up ur c concepts like array,dynamic memory allocation and
> pointers. and sql is very important like view,index .. and little bit
> imp commands of unix
>
> On 8/15/11, prateek gupta  wrote:
>
>
>
>
>
>
>
> > hey guys,
> > Tell me aboutamdocsinterview questions and also post the good links
> > for preparation as my interview is scheduled on friday.
> > thanks in advance.
> > Regards
> > Prateek Gupta
>
> > --
> > 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] regarding amdocs interview questions

2011-08-15 Thread prateek gupta
hey guys,
Tell me about amdocs interview questions and also post the good links
for preparation as my interview is scheduled on friday.
thanks in advance.
Regards
Prateek Gupta

-- 
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] string easy question

2011-08-02 Thread prateek gupta
When the strings are equal then strcmp returns zero so your condition will
become if (0).
In order to correct it use

if(strcmp(str1,str2)==0)
pritnf("equal");
else
Unequal.

On Tue, Aug 2, 2011 at 7:47 PM, Vijay Khandar wrote:

> #include
> #include
> #include
> void main()
> {
> clrscr();
> char str1[]="Hello";
> char str2[]="Hello";
> int i;
> if(strcmp(str1,str2))
> printf ("\n Equal");
> else
> printf("\n Unequal");
> getch();
> }
>
> Plz anyone explain me o/p with explanation.
>
> Vijay
>
> --
> 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.
>
>


-- 
Prateek Gupta
7th sem, Information Technology,
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.



Re: [algogeeks] Re: MS c output ques

2011-08-01 Thread prateek gupta
it prints the first n characters of the string that matches any character of
"india". The printing stops as soon as the first character different from
the characters of "india" is encountered.

On Mon, Aug 1, 2011 at 9:36 PM, ramya reddy  wrote:

>
> Hey all,
>
> I have a doubt .
> what if there is no xor operator..
> what if it is simply %[india]..how it behaves?
> --
> Regards
> Ramya
> *
> *
> *Try to learn something about everything and everything about something*
>
> --
> 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.
>



-- 
Prateek Gupta
7th sem, Information Technology,
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.



[algogeeks] puzzle

2011-07-31 Thread prateek gupta
Can anyone plz tell me
1. how to get a fair result from a unfair coin?
2. How to use a fair coin to get unfair result?

-- 
Prateek Gupta

-- 
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 help on bits?

2011-07-31 Thread prateek gupta
C= A^B then count number of bits set in C.

On Sun, Jul 31, 2011 at 5:52 PM, Nikhil Gupta wrote:

> Given two integers A & B. Determine how many bits required to convert A to
> B. Write a function int BitSwapReqd(int A, int B);
>
> --
> Nikhil Gupta
>
> --
> 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.
>



-- 
Prateek Gupta
7th sem, Information Technology,
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.



[algogeeks] quick sort query

2011-07-27 Thread prateek gupta
void quicksort( T[] A, Integer left, Integer right)
if ( left < right )
q = partition( A, left, right) ;
quicksort ( A, left, q–1);
quicksort ( A, q+1, right) ;

Integer partition( T[] A, Integer left, Integer right)
m = left + right / 2;
swap( A[left],  A[m]);
pivot = A[left] ;
lo = left+1; hi = right;
while ( lo ≤ hi )
while ( A[hi] > pivot )
  hi = hi – 1;
while ( lo ≤ hi and A[lo] <
∼ pivot )
  lo = lo + 1;
if ( lo ≤ hi )
  swap( A[lo], A[hi]);
   lo = lo + 1;  hi = hi – 1;
swap( A[left], A[hi]);
return hi

plz tell me the case for (lo=hi) in while loop in partition.

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

2011-06-22 Thread prateek gupta
yup, got it thanks!!!


On Thu, Jun 23, 2011 at 11:27 AM, sunny agrawal wrote:

> last line is
> *in worst case k=1 only 2*n comparisons will be there hence O(n)*
>
>
>
> On Thu, Jun 23, 2011 at 11:26 AM, sunny agrawal 
> wrote:
>
>> Lets Consider the case of Naive matching in which at some shift s first k
>> characters are matched and next character does not match so instead of
>> starting from s+1 shift we can safely jump to s+k because all characters of
>> pattern are distinct
>> in worst case k=1 only an comparisons will be there hence O(n)
>>
>> On Thu, Jun 23, 2011 at 11:19 AM, Piyush Sinha 
>> wrote:
>>
>>>
>>> Read KMP algorithm..
>>>
>>>
>>> On Thu, Jun 23, 2011 at 11:17 AM, prateek gupta 
>>> wrote:
>>>
>>>> In naive string matching how can the knowledge abt. pattern that it has
>>>> all different characters can be used to accelerate the algorithm to 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.
>>>>
>>>
>>>
>>>
>>> --
>>> *Piyush Sinha*
>>> *IIIT, Allahabad*
>>> *+91-8792136657*
>>> *+91-7483122727*
>>> *https://www.facebook.com/profile.php?id=10655377926 *
>>>
>>>  --
>>> 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.
>>>
>>
>>
>>
>> --
>> Sunny Aggrawal
>> B-Tech IV year,CSI
>> Indian Institute Of Technology,Roorkee
>>
>>
>
>
> --
> Sunny Aggrawal
> B-Tech IV year,CSI
> Indian Institute Of Technology,Roorkee
>
>  --
> 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] string matching

2011-06-22 Thread prateek gupta
In KMP there is a pre processing time of O(m).
which is not there in naive.
The question says to accelerate naive string matching.


On Thu, Jun 23, 2011 at 11:19 AM, Piyush Sinha wrote:

>
> Read KMP algorithm..
>
>
> On Thu, Jun 23, 2011 at 11:17 AM, prateek gupta wrote:
>
>> In naive string matching how can the knowledge abt. pattern that it has
>> all different characters can be used to accelerate the algorithm to 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.
>>
>
>
>
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-8792136657*
> *+91-7483122727*
> *https://www.facebook.com/profile.php?id=10655377926 *
>
>  --
> 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 matching

2011-06-22 Thread prateek gupta
In naive string matching how can the knowledge abt. pattern that it has all
different characters can be used to accelerate the algorithm to 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.



Re: [algogeeks] is it correct??

2011-06-14 Thread prateek gupta
no
the no of elements in an array should be known to compiler before execution
of the program.


On Tue, Jun 14, 2011 at 8:09 PM, amit  wrote:

> is such a declaration correct:
> cin>>x;
> int a[x];
>
> --
> 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] help

2011-06-13 Thread prateek gupta
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 wrote:

> || and && operators are called short circuit operators and need not
> necessarily evaluate the entire expression. In ex 1, m= ++i && ++j || ++k;
> here, ++i and ++j are done. then the result is orred with ++k; here,
> irrespective of the value of the right side(++k), the result would always be
> 1. Hence, the results.
>
>
> On Mon, Jun 13, 2011 at 6:12 PM, sahil  wrote:
>
>> can sme body tell me..?
>>
>> 1)
>> #include 
>> 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 
>> 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 2 0 1
>>
>>
>> 3)
>> #include 
>> 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 1 1
>>
>>
>>
>>  how came this output.???
>> in the first code why..k is not incremented.??
>> and hw the value of m came out to be 1...?
>>
>>
>> --
>> 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,
> Shachindra A C
>
>  --
> 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: find error

2011-06-11 Thread prateek gupta
its working in dev-cpp.

On Sun, Jun 12, 2011 at 10:40 AM, Balaji S  wrote:

> no error ryt??
>
> --
> 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] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-05-04 Thread Prateek
Hey Rajeev,
Can you mail me the pdf of the book.
My email is mailtoprat...@gmail.com.

The google doc isnt opening. It is giving an error - "Sorry, we are
unable to retrieve the document for viewing or you don't have
permission to view the document.".

Thanx in advance.
--
Prateek

On Apr 14, 9:29 am, Rajeev Kumar  wrote:
> check this 
> link:https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=1B5...
>
> If you have any problem in access,please inform me
>
> On Thu, Apr 14, 2011 at 1:04 AM, Abhishek Goswami 
> 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%28sc...
>
> >> 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 
> >>> wrote:
>
> >>>> ++
>
> >>>> On Tue, Mar 22, 2011 at 9:51 PM, Anurag atri 
> >>>> wrote:
>
> >>>>> and me too :)
>
> >>>>> On Tue, Mar 22, 2011 at 9:28 PM, Nikhil Mishra 
> >>>>> 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 gro

Re: [algogeeks] c aps

2011-01-09 Thread Prateek Jain
the printf function returns 1 when it prints a string..
for (1;1&&i--;1)
{
printf("bat");
}
note that i=2 has been cunningly initialized before. and the decrement of i
has been done in middle expression of the for loop
hence, actually its like
for(;i--;)
{
}

how many times will this execute? Twice.i=1 and i=2, for i=O, the middle
condition shall become O and hence fails.


therefore the ouput.

On Sun, Jan 9, 2011 at 6:48 PM, siva viknesh  wrote:

>
> #include
> int main()
> {
> int i=2;
> for(printf("cat ");printf("rat ")&&i--;printf("mat "))
> {
>
>printf("bat ");
>
>  }
>
> }
>
>
> ouput : cat rat bat mat rat bat mat rat
>
> can anybody plz explain how we get this output??
> --
> Regards,
> $iva
>
>  --
> 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.
>

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



[algogeeks] Re: few topics to refer back

2006-04-09 Thread Prateek

Check 

http://online-books-reference.blogspot.com

for more..


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Interview question: can this be done?

2006-02-16 Thread Prateek

" 4), which will vary the value of k for many times. "

I think to cover up this problem..
1. we can store the starting and ending numbers for every K in another
file (with file name of every set) and then sort the file names
according to the starting values for every K set,

2. hence creating an index based on the starting values of every set..

3. so to check if a number is in a set or not we will simply have to
perform a binary search on this index

4. and then for every matching set scan that particular set's file to
see if the number is present or not.

Thus the time for checking multiple instances will be reduced to some
extent..

Regards,
Prateek.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Interview question: can this be done?

2006-02-14 Thread Prateek

I think a better alternative could be to choose EVEN 5000 numbers
(taking mod of 2 of any number out of these can help to check whether
it can be in the set or not) and then make out set of 200 from these
5000 even numbers..

the set of 200 nos can be written on the disk in a sorted manner so
that a binary search can be applied to them.. we can take out the first
and the last number from the file and check whether its there or not..
and if its in range then apply binary search to find out the number.