Re: [algogeeks] Amazon Onsite Chennai SDE

2011-11-14 Thread rajeev bharshetty
Levensteins algorithm On 14 Nov 2011 18:19, "aniket chatterjee" wrote: > > yeah, that is normal bryteforce. Any better idea? > > On 11/14/11, Ankur Garg wrote: > > We can use a trie here .. Create a trie with all words of dictionary . > > > > Now delete the last character of the word and check i

Re: [algogeeks] Source Bits

2011-09-27 Thread rajeev bharshetty
5.5 Lakhs On Tue, Sep 27, 2011 at 7:01 PM, aditya kumar wrote: > rajeev hw much did they offer u ? > > > On Tue, Sep 27, 2011 at 5:55 PM, rajeev bharshetty > wrote: > >> Technical Interview : >> >>- Tell me about yourself ? >> >> >> &

Re: [algogeeks] Source Bits

2011-09-27 Thread rajeev bharshetty
Technical Interview : - Tell me about yourself ? I emphasized more on my OpenSource projects and the Contribution to Amarok ( Video Player Project ). I even stressed on my knowledge of Qt Programming ( C++ library for Developing User Interfaces on Linux Platform ). - What

Re: [algogeeks] Source Bits

2011-09-24 Thread rajeev bharshetty
SourceBits visited *RV College of Engineering *in Bangalore on 23rd Sepetember. There were 20 aptitude questions and 10 basic C Questions. 1 Technical interview Round and 1 HR Round. Apti Questions were usually from RS aggarwal (OK Type) C Questions were very easy . Just brush up the basics . In Te

Re: [algogeeks] activation record

2011-09-02 Thread rajeev bharshetty
http://www.enel.ucalgary.ca/People/Norman/enel339fall2000/activ_rec/ False On Fri, Sep 2, 2011 at 10:13 PM, Kamakshii Aggarwal wrote: > what are activation records?? > > > On Fri, Sep 2, 2011 at 9:00 PM, sukran dhawan wrote: > >> true >> >> >> On Fri, Sep 2, 2011 at 7:44 PM, priya ramesh < >> lo

Re: [algogeeks] Hexadecimal to Decimal

2011-09-01 Thread rajeev bharshetty
@Don : Thanks , are there any other methods On Thursday, September 1, 2011, Don wrote: > int n; > char *string = "0xff"; // Or whatever > sscanf(string, "%x", &n); > printf("%d\n", n); > > On Sep 1, 11:34 am, rShetty > wrote: > > Given a Hexadecimal value as a string, give a C Code to conve

Re: [algogeeks] Hexadecimal to Decimal

2011-09-01 Thread rajeev bharshetty
@Arpit : Could you please post the solution . On Thursday, September 1, 2011, Arpit Sood wrote: > in the same way as you do for binary to decimal, only base needs to be > changed > > On Thu, Sep 1, 2011 at 10:04 PM, rShetty > > > wrote: > >> Given a Hexadecimal value as a string, give a C Code

[algogeeks] Motorola Interview Question

2011-08-31 Thread rajeev bharshetty
What does Blacklisting of drivers mean in Linux ? Explain How you go about doing Blacklisting of Drivers ? Explain??? -- Regards Rajeev N B "*Winners Don't do Different things , they do things Differently"* -- You received this message because you are subscr

Re: [algogeeks] recursion

2011-08-31 Thread rajeev bharshetty
Non Recursive calls store the local variables and stuff in stack whereas in recursive calls the return addresses and the local variables for each call are stored as stack frames with frame pointers and stack pointers. On Thursday, September 1, 2011, teja bala wrote: > @priya > stack is a non rec

Re: [algogeeks] why dynamic memory called heat?

2011-08-31 Thread rajeev bharshetty
The main memory is divided into four segments they are Heap segment Data Segment Code segment and Stack segment All dynamically allocated memory is stored in Heap segment which grows both upwards and downwards in memory. You allocate memory dynamically in C using malloc() calloc() and realloc() fu

Re: [algogeeks] Re: fork()

2011-08-31 Thread rajeev bharshetty
I ran the code on gcc and the answer is 20 times On Wed, Aug 31, 2011 at 9:59 PM, SANDEEP CHUGH wrote: > it will be 16 .. > > On Wed, Aug 31, 2011 at 9:54 PM, abhishek wrote: > >> >> i think it will be 16 (not sure ) >> >> can anyone explain how it will be 20, >> On Aug 31, 9:02 pm, SANDEEP CHUGH

Re: [algogeeks] C puzzle

2011-08-29 Thread rajeev bharshetty
@Anup : I think you should also try to compile and check the answer... May be I am wrong But compiler won't On Mon, Aug 29, 2011 at 11:02 PM, Anup Ghatage wrote: > @Rajeev: > > I had written down the recursion tree on paper but since you said that > there were 10 reds and greens, I compiled

Re: [algogeeks] C puzzle

2011-08-29 Thread rajeev bharshetty
Each of the red and green are being called 10 times.. On Mon, Aug 29, 2011 at 9:41 PM, Anup Ghatage wrote: > If I'm not mistaken, > > red() will be called 6 times and green() will be called 10 times. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm

Re: [algogeeks] String Reverse

2011-08-29 Thread rajeev bharshetty
@karan :' Could you please come up with a code or algo for the same On Mon, Aug 29, 2011 at 7:38 PM, rajeev bharshetty wrote: > @Dheeraj : I think the question says no swapping. > > > On Mon, Aug 29, 2011 at 6:56 PM, Karan Thakral wrote: > >> use xor inplace of a s

Re: [algogeeks] String Reverse

2011-08-29 Thread rajeev bharshetty
@Dheeraj : I think the question says no swapping. On Mon, Aug 29, 2011 at 6:56 PM, Karan Thakral wrote: > use xor inplace of a swap...u wont require extra space or memory... > printing isnt a solution... > > > On Mon, Aug 29, 2011 at 6:15 PM, Dheeraj Sharma < > dheerajsharma1...@gmail.com> wrote:

Re: [algogeeks] Dead code removal for c program

2011-08-27 Thread rajeev bharshetty
Usually compilers do the job of dead code elimination during optimizations. Gcc does that during compilation. On Sun, Aug 28, 2011 at 1:34 AM, rajeev bharshetty wrote: > You can go through this link > http://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html > > > On Sat, Aug 27,

Re: [algogeeks] Dead code removal for c program

2011-08-27 Thread rajeev bharshetty
You can go through this link http://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html On Sat, Aug 27, 2011 at 6:49 PM, john robin wrote: > Hi, > > I've an interesting task. Given a c program say hi.c as input to a > program, the program should be able to return a file hi1.c such that > all dead

Re: [algogeeks] Android development

2011-08-25 Thread rajeev bharshetty
http://openprobe.blogspot.com/2011/03/android-sdk-installation-in-linux.html this might help!!! On Thu, Aug 25, 2011 at 3:09 PM, Rajeshwar Patra wrote: > How to install android on my system . > I am using ubuntu 10.10 > > > -- > *Rajeshwar Patra,* > *MCA final year,* > *Nit Durgapur* > > -- > Y

Re: [algogeeks] Doubt

2011-08-21 Thread rajeev bharshetty
Its 2 2 on gcc compiler. Some compilers support overwriting of the const variables which is usually a bug if program expects the value of a variable to be constant . Usually newer compilers don't show such bugs. On Sun, Aug 21, 2011 at 8:59 PM, Sanjay Rajpal wrote: > i was also amazed to see th

Re: [algogeeks] Re: C output

2011-08-17 Thread rajeev bharshetty
No the warning in gcc is ibm1.c: In function ‘main’: ibm1.c:7:19: warning: initialization discards qualifiers from pointer target type On Wed, Aug 17, 2011 at 11:50 AM, venkat wrote: > yes u r correct > > On Aug 16, 8:22 pm, Sanjay Rajpal wrote: > > This is becuase "Hello" is a constant strin

Re: [algogeeks] mutex

2011-08-17 Thread rajeev bharshetty
Mutexes are used for synchronisation. Basically they allow only one process to access any shared memory at a time thus helping sync among processes. On Wed, Aug 17, 2011 at 9:29 PM, Aman Kumar wrote: > can we use mutex for synchronization? > > if yes why? > > -- > You received this message beca

Re: [algogeeks] Re: Memory Leak

2011-08-16 Thread rajeev bharshetty
You can refer http://www.linuxjournal.com/article/6556 and http://msdn.microsoft.com/en-us/library/ms859415.aspx Quote from MSDN : *"**Basically, you can spot a memory leak when you detect an unexplained increase in either committed system memory—memory used by various applications—or in memory o

Re: [algogeeks] amazon question

2011-08-15 Thread rajeev bharshetty
First approach : I think you can solve the above problem using Levenshtein Distance (edit distance which is basically no of operations required to transform word1 to word2) . Algo can be found here http://en.wikipedia.org/wiki/Levenshtein_distance Second approach : Store the words in trie data

Re: [algogeeks] mcq-os

2011-08-15 Thread rajeev bharshetty
@kamakshi : Check this link. It has a very good explanation http://stargazer.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/sync.htm On Mon, Aug 15, 2011 at 6:37 PM, sandeep pandey wrote: > ya i also think all of d above.. > > -- > You received this message because you are subscribed to t

Re: [algogeeks] operating system mcq

2011-08-15 Thread rajeev bharshetty
@kamakshi : Check for the mediafire link and not the filesonic link http://www.mediafire.com/?e69mami0u2mvt67 On Mon, Aug 15, 2011 at 5:12 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > Do anyone of you have c++ MCQ book?? Perhaps test your c++ skills by > kanetkar?? I'm not able to

Re: [algogeeks] Operators

2011-08-15 Thread rajeev bharshetty
Does context dependent means a single operator having different meaning when used in different contexts or scenarios??? If so then * is dereferencing operator for pointers and also an arithmetic operator as *a pointer dereference and a*b multiplication and & (bitwise and) and also address operator

Re: [algogeeks] mcq-os

2011-08-15 Thread rajeev bharshetty
All the above 1,2,3 Semaphores help to prevent race conditions in a program. They help in process synchronization by allowing multiple processes access to a common shared memory . and they also solve the problem of mutual exclusion allowing only a single process in a critical region at a time. Cor

Re: [algogeeks] operating system mcq

2011-08-15 Thread rajeev bharshetty
Here is the alternative link http://www.mediafire.com/?e69mami0u2mvt67 On Mon, Aug 15, 2011 at 4:52 PM, aditi garg wrote: > @rajeev: it is saying that the link has expired...Do u hv any alternative > link...?? > > On Mon, Aug 15, 2011 at 4:21 PM, rajeev bharshetty > wrote:

Re: [algogeeks] operating system mcq

2011-08-15 Thread rajeev bharshetty
Timothy J William MCQ's http://s244.filesonic.in/download/1662179664/4e47a18f/6312d950/0/1/b4d72a29/0/49e7f6c2daf916cf807a0678329c153d3324519b On Mon, Aug 15, 2011 at 3:24 AM, nivedita arora wrote: > hi, > can someone pls provide good source from where i can prac mcq on OS . > thx > > -- > You

Re: [algogeeks] Memory Leak

2011-08-14 Thread rajeev bharshetty
Valgrind is an effective open source tool to detect memory leaks and many more bugs in the program. http://valgrind.org/ On Mon, Aug 15, 2011 at 6:31 AM, *$* wrote: > use > > _crtdumpmemoryleaks() .. will work only in debug version. > > > On Mon, Aug 15, 2011 at 4:01 AM, Ankur Garg wrote: > >

Re: [algogeeks] Todays PEP question

2011-08-14 Thread rajeev bharshetty
3 is the answer . do being exit controlled loop , x is incremented to 2 and then checked for condition which happens to be false here (2>2) So t is incremented only 3 times. On Mon, Aug 15, 2011 at 12:44 AM, aditi garg wrote: > 3 > > On Mon, Aug 15, 2011 at 12:38 AM, Adi Srikanth wrote: > >> int

Re: [algogeeks] what is the difference between a class and structure in c++? pl help

2011-08-14 Thread rajeev bharshetty
Class by default is private and struct by default is public. On Sun, Aug 14, 2011 at 7:13 PM, programming love < love.for.programm...@gmail.com> wrote: > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send ema

Re: [algogeeks] Doubt !!!!!!

2011-08-14 Thread rajeev bharshetty
@anika and sagar : Thanks Got it. On Sun, Aug 14, 2011 at 6:25 PM, sagar pareek wrote: > @rshetty > > for the first code > u have array as : --_ _ _ _ _ _ _ _ _ _ ( _ denotes block of int) > so sizeof(*p) is ofcourse give you sze of int > > > now u have int *p[10][20]; > > which can be view

Re: [algogeeks] String Doubt

2011-08-13 Thread rajeev bharshetty
3,4 On Sat, Aug 13, 2011 at 7:39 PM, Raman wrote: > In statement 2, isn't p pointing to const string, as we cannot modify the > characters of the string. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the

Re: [algogeeks] Re: Normalised !!

2011-08-13 Thread rajeev bharshetty
@divye and abhishek : Thanks :) On Tue, Aug 9, 2011 at 11:00 PM, DK wrote: > Please read the specifications IEEE 754 for representation of single digit > floating point numbers. > > http://en.wikipedia.org/wiki/Single_precision_floating-point_format > http://en.wikipedia.org/wiki/IEEE_754-2008 >

Re: [algogeeks] Data Structure Objective Question

2011-08-11 Thread rajeev bharshetty
Queue On Thu, Aug 11, 2011 at 10:36 PM, Mani Bharathi wrote: > Which data structure is useful in transferring a given graph by breadth > first search. > > > a. heapb. linkedlist c. array d. stack e. queue > > -- > You received this message because you are subscribed to the Google

Re: [algogeeks] Re: Trees

2011-08-11 Thread rajeev bharshetty
tion missing. i.e 5 :| > > On Aug 11, 9:01 pm, rajeev bharshetty wrote: > > @all : Could anyone explain it using the tree diagram . @nithin : 4 may > not > > be th answer i am not able to plot into a tree satisfying those > constarints > > > > On Thu, Aug 11,

Re: [algogeeks] Trees

2011-08-11 Thread rajeev bharshetty
@all : Could anyone explain it using the tree diagram . @nithin : 4 may not be th answer i am not able to plot into a tree satisfying those constarints On Thu, Aug 11, 2011 at 9:16 PM, Nitin Nizhawan wrote: > i guess answer is c. 4 > > n*i+1 > > > On Thu, Aug 11, 2011 at 8:01 PM, rShetty wrote:

Re: [algogeeks] os

2011-08-11 Thread rajeev bharshetty
Round Robin .. On Thu, Aug 11, 2011 at 11:01 AM, siddharam suresh wrote: > shortest preemptive job first > Thank you, > Siddharam > > > > On Thu, Aug 11, 2011 at 10:49 AM, krishna meena < > krishna.meena...@gmail.com> wrote: > >> Consider a set of n teaks with known runtimes r1,r2,r3rn to b

Re: [algogeeks] C easy doubt

2011-08-08 Thread rajeev bharshetty
Oh Sorry errata!!! in the second sentence it is a+1 which will point to next element in the array. On Mon, Aug 8, 2011 at 8:02 PM, payel roy wrote: > Yes it is... &a+1 will point to starting address of a + 12 * size of int. > byte. > > > On 8 August 2011 19:59, Brijesh Upadhyay wrote: > >> int

Re: [algogeeks] C easy doubt

2011-08-08 Thread rajeev bharshetty
&a+1 is valid . Basically &a is the address of the entire array so, &arr+1 will point beyond this array. a is the base address and &a+1 will point to the next element in the array. On Mon, Aug 8, 2011 at 7:59 PM, Brijesh Upadhyay < brijeshupadhyay...@gmail.com> wrote: > int main() > { >int a[

Re: [algogeeks] Amazon Question

2011-08-08 Thread rajeev bharshetty
4) b 3) a Correct me if i am wrong On Mon, Aug 8, 2011 at 7:54 PM, Dipankar Patro wrote: > 1. O(n) > > 2. (b) > > > > On 8 August 2011 19:24, ankit sambyal wrote: > >> Plz give the answers ... >> >> 1. In a binary max heap containing n numbers, the smallest element can be >> found in time ?? >

Re: [algogeeks] amazon

2011-08-07 Thread rajeev bharshetty
b:Shell sort On Sun, Aug 7, 2011 at 10:56 PM, Kamakshii Aggarwal wrote: > 1.what is the best sorting method for almost sorted array? > a.quicksort > c.hapsort > c.shell sort > d.bubble > > -- > Regards, > Kamakshi > kamakshi...@gmail.com > > -- > You received this message because you are subscrib

Re: [algogeeks] address calculation

2011-08-06 Thread rajeev bharshetty
@aditi : I Think the output depends on whether it is row major or column major representation in memory . Does he row amjor or column On Sun, Aug 7, 2011 at 12:19 AM, aditi garg wrote: > oh @ akshay y ru doing 10x4??? 10 is the no of rows not the columns so it > shud be 15x3+4...and

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread rajeev bharshetty
So Basically I drew this conclusion ( Correct if I am wrong) On Gcc char 1 byte but allocates 4 bytes padding 3 bytes for performance improvement. 4 double 8 bytes allocates 8 bytes ( multiple of 4 so no probs no padding) 8 int 4 bytes allocates 4 bytes. 4 -

Re: [algogeeks] wht does this error means

2011-08-06 Thread rajeev bharshetty
I think you copied and pasted the code from some resource and then tried to compile it. The error shown above are usually "smart quotes" they are shown usually when there is problem with the double quotation marks in the program (printf) So to remove that error, remove the double quotation marks i

Re: [algogeeks] Reverse Bits

2011-08-05 Thread rajeev bharshetty
@mithun : Thanks On Fri, Aug 5, 2011 at 6:37 PM, mithun bs wrote: > Hi Rajeev, > > I follow similar approach. The basic logic is swap bits of a pair, then > swap nibbles(2 bits) and then swap (4bits), 8bits and go on. > > So for ex. 0110 1101 1100 0101 > In first step, I swap bits of each pair.

Re: [algogeeks] Doubt

2011-08-03 Thread rajeev bharshetty
Since you are maintaining two different data structures ,one for the old tree and the other for new tree . I think this isn't considered in-place algorithm . The algorithm to be in-place should not use any additional data structures . Correct me if I am wrong . On Thu, Aug 4, 2011 at 2:52 AM, Gaur

Re: [algogeeks] oracle question

2011-08-03 Thread rajeev bharshetty
@aditi : Operating systems by Andrew S Tanenbaum is the classic book for Operating systems. On Wed, Aug 3, 2011 at 11:20 PM, aditi garg wrote: > @Rajeev: could u suggest some source to learn OS quickly...I dint have it > as my subjct,bt i need it fr placements > > > On Wed, Aug 3, 2011 at 11:

Re: [algogeeks] oracle question

2011-08-03 Thread rajeev bharshetty
@naveen : Library calls inturn call system calls . System calls are basically call to specific functions provided in the kernel which does some predefined activities . Library calls inturn call the system calls of the kernel to achieve a specific job . For example malloc() function is built on top

Re: [algogeeks] C-Question

2011-08-01 Thread rajeev bharshetty
Becaus eof Bitwise and 0110 (6) & 0001 0010 (10) 0010 (2) So 0&0 0 0&1 0 1&0 0 1&1 1 On Mon, Aug 1, 2011 at 3:31 PM, Vijay Khandar wrote: > main() > { > int a=6,b=10,x; > x=a&b; > printf("%d",x); > } > > O/P=2 > Plz any one explain me ,how

Re: [algogeeks] Feedback of the book!!!!!!!

2011-08-01 Thread rajeev bharshetty
Awesome Book ,for interviews : Covers wide range of interview questions . On Mon, Aug 1, 2011 at 12:23 PM, AMAN AGARWAL wrote: > Hi, > > I am planning to buy a book > > cracking the coding interview by Gayle Laakmann. Please give your > feedbacks. > > > > -- > AMAN AGARWAL > "Success is not fina

Re: [algogeeks] problem of structur

2011-07-31 Thread rajeev bharshetty
*#include* * * * * *struct emp* *{* *char name[20];* *int age;* *};* *f(struct emp ee)* *{* *printf("%s ...%d\n",ee.name,ee.age);* *}* *main()* *{* *struct emp e={"qwe",12};* *f(e);* *}* This above code works fine on gcc 4.3.2 output : qwe ...12 On Sun, Jul 31, 2011 at 8:38 PM, Anika Jain wrote

Re: [algogeeks] Pointer

2011-07-31 Thread rajeev bharshetty
=*a;* >> **a^=*b;* >> ?? >> >> On Sun, Jul 31, 2011 at 7:19 PM, rajeev bharshetty >> wrote: >> >>> *#include* >>> *int main()* >>> *{* >>> *int i=10;* >>> *int j=20;* >>> *int *a,*b;* >>> *a =&

Re: [algogeeks] Pointer

2011-07-31 Thread rajeev bharshetty
*#include* *int main()* *{* *int i=10;* *int j=20;* *int *a,*b;* *a =&i;* *b=&j;* *printf("before""%d%d\n",*a,*b);* **a^=*b;* **b^=*a;* **a^=*b;* *printf("after""%d%d",*a,*b);* *return 0;* *}* * * *This swaps pointers * On Sun, Jul 31, 2011 at 7:15 PM, Nikhil Gupta wrote: > How to swap two p

Re: [algogeeks] Bugs in a program

2011-07-31 Thread rajeev bharshetty
http://www.softwaretestinghelp.com/priority-and-severity/ On Sun, Jul 31, 2011 at 3:02 PM, Puneet Gautam wrote: > What is meant by 'priority' and 'severity' of a bug..? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to thi

Re: [algogeeks] random generation

2011-07-31 Thread rajeev bharshetty
*#include* * * *int main()* *{* * * *int x,a,b,i,n;* *printf("\n Enter the value of n");* *scanf("%d",&n);* *printf("\n Enter Psoitive integer a");* *scanf("%d",&a);* *printf("\n Enter the positisve integer b");* *scanf("%d",&b);* *for(i=1;i<=15;i++)* *{* * n= (a*n + b);* * printf("%d\n",n);* *}* *

Re: [algogeeks]

2011-07-31 Thread rajeev bharshetty
t;*"); printf("\n"); } for(i=1;i<=n;i++) { for(j=1;j<=i;j++) printf(" "); for(j=1;j<=(n-i);j++) printf(" ""*"); printf("\n"); } return 0; } o/p * * * * * * * * * * * * * * * * On

Re: [algogeeks]

2011-07-31 Thread rajeev bharshetty
#include int main() { int i,j,n; printf("\n Enter the value of n"); scanf("%d",&n); for(i=1;i<=n;i++) { for(j=1;j<=n-i;j++) printf(" "); for(j=1;j<=i;j++) printf("*"); printf("\n"); } for(i=1;i<=n;i++) { for(j=1;j<=i;j++) printf(" "); for(j=1;j<=n-i;j++) printf("*"

Re: [algogeeks]

2011-07-30 Thread rajeev bharshetty
y it is printing zero ...means how dis prgrm is wrkng step by >> step >> >> >> On Sun, Jul 31, 2011 at 11:03 AM, rajeev bharshetty > > wrote: >> >>> *#include* >>> *#ifdef getchar* >>> *#undef getchar* >>> *#else* >>>

Re: [algogeeks]

2011-07-30 Thread rajeev bharshetty
*#include* *#ifdef getchar* *#undef getchar* *#else* *#define getchar scanf("%c",&ch);* *#endif* *main()* *{* *char ch;* *int c;* *c=getchar;* *printf("%d",c);* *}* This above code works as expected On Sun, Jul 31, 2011 at 11:02 AM,

Re: [algogeeks]

2011-07-30 Thread rajeev bharshetty
Above Program is showing error on gcc compiler *ms52.c: In function ‘main’:* *ms52.c:11:19: error: expected expression before ‘)’ token* Check the code ... On Sun, Jul 31, 2011 at 10:59 AM, SHIVAM AGRAWAL wrote: > can any xplain me d output and working of dis code... > #include > #ifdef ge

Re: [algogeeks] Re: Amazon

2011-07-30 Thread rajeev bharshetty
@amir : Could you please share the questions they asked?? Thanks On Sat, Jul 30, 2011 at 4:52 PM, Amir wrote: > In Amazon First Round all about Linux and Open Source Commands and Usage... > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" gro

Re: [algogeeks] FB intern

2011-07-30 Thread rajeev bharshetty
@amol and saurabh : How exactly is that formula derived for this problem ? I need to know the method to evaluate such problems in the feature . Thank you On Sat, Jul 30, 2011 at 1:43 PM, saurabh singh wrote: > Thanx mate...You rock.:) > > > On Sat, Jul 30, 2011 at 1:40 PM, Amol Sharma wrote:

Re: [algogeeks] 32 bit?

2011-07-29 Thread rajeev bharshetty
If pointer size is 4bytes then it is 32 bit machine and if 8 bytes it is 64 bit On Sat, Jul 30, 2011 at 11:51 AM, Nikhil Gupta wrote: > How do you find out if a machine is 32 bit or 64 bit? > > I was thinking since the size of pointer variable is different in the 2 > configurations, we can declar

[algogeeks] rajeev bharshetty wants to chat

2011-07-29 Thread rajeev bharshetty
--- rajeev bharshetty wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-fa8b2f68fb-7b53be141f-z1723Z4LtlasPTsvQH98EB

Re: [algogeeks] Re: Testcases

2011-07-29 Thread rajeev bharshetty
@hary are the conditions same for both acute and obtuse triangles as you mentioned ??? On Sat, Jul 30, 2011 at 12:46 AM, hary rathor wrote: > > if(c^2 if(c^2 =a^2+b^2) right angle > if(c^2 > NOT : ^ is used for power operation > > -- > You received this message because you are subscribed to t

Re: [algogeeks] problem at line number 12

2011-07-29 Thread rajeev bharshetty
@ankur : Dude I think you compiled in ideone as C++ language but it is C :) http://ideone.com/HZhHu On Fri, Jul 29, 2011 at 11:51 PM, rajeev bharshetty wrote: > @ankur: But the same above code wont show any error on my gcc 4.3.2 running > on Open Suse 11.4 > > > On Fri, Jul

Re: [algogeeks] problem at line number 12

2011-07-29 Thread rajeev bharshetty
@ankur: But the same above code wont show any error on my gcc 4.3.2 running on Open Suse 11.4 On Fri, Jul 29, 2011 at 11:48 PM, Ankur Khurana wrote: > http://ideone.com/OaCDR > > > On Fri, Jul 29, 2011 at 11:45 PM, rajeev bharshetty > wrote: > >> @ankur :wh

Re: [algogeeks] problem at line number 12

2011-07-29 Thread rajeev bharshetty
eferenced here .Check the basci diff >> >> p is a pointer , but n is a pointer to a pointer. >> >> >> On Fri, Jul 29, 2011 at 11:34 PM, Arshad Alam wrote: >> >>> wow great... but why it is so yaar? >>> ptr=n and ptr=n[0] is same na? >>

Re: [algogeeks] Re: MS question

2011-07-29 Thread rajeev bharshetty
Test cases for MSN Search Engine 1 : Check for auto completion feature (The auto completion based on the prefix should provide suggestions for the most searched keyword with that prefix) . 2 : The spelling correction feature which shows as to what the user actually meant. This should be highly

Re: [algogeeks] problem at line number 12

2011-07-29 Thread rajeev bharshetty
#include void main() { int n[3][3]= { 2,4,3, 6,8,5, 3,5,1 }; int i,*ptr; ptr= n; for(i=0;i<=8;i++) printf("\n%d",*(ptr+i)); } In gcc 4.3.2 no error ,it is j

Re: [algogeeks] Doubt

2011-07-29 Thread rajeev bharshetty
~ does bitwise not on the operand . It simply inverts all the bits . On Fri, Jul 29, 2011 at 7:09 PM, Nikhil Gupta wrote: > And what does "~" operator do? > > > On Fri, Jul 29, 2011 at 5:59 PM, aditi garg wrote: > >> >> right shift.^ Xor,& and,| OR operators... >> the statement means u r anding t

Re: [algogeeks] DS representation.

2011-07-29 Thread rajeev bharshetty
You can use a Hash map which maps the coefficients of the equation and their exponents. Is this feasible ?? On Fri, Jul 29, 2011 at 3:10 PM, sunny agrawal wrote: > Array that that stores A,B,C,D,E. > > it looks like u r on some telephonic interview :P > > On Fri, Jul 29, 2011 at 3:06 PM, Pune

Re: [algogeeks]

2011-07-29 Thread rajeev bharshetty
B Trees data structures are optimal for such problems. These algorithms help to access large amount of data which we cannot fit into main memory . On Fri, Jul 29, 2011 at 2:58 PM, Puneet Gautam wrote: > If u have to sort a large amount of data,but the memory space is > insufficient for the same..

Re: [algogeeks] Novell - Technical Interview

2011-07-28 Thread rajeev bharshetty
1 )System map in Linux is a Symbol table used by the kernel. Mapping of symbol names and addresses. 2 ) IS it /usr/src/linux ??? On Fri, Jul 29, 2011 at 8:10 AM, Reynald wrote: > 1. What is a System Map file in Linux? Why do we need it? > 2. Mention the file name which is a symbolic link to the

Re: [algogeeks] Re: C output

2011-07-28 Thread rajeev bharshetty
No error in gcc 4.3.2 too On Thu, Jul 28, 2011 at 2:47 PM, Rohit Srivastava wrote: > no error in dev c++. > > > On Thu, Jul 28, 2011 at 2:43 PM, Piyush Kapoor wrote: > >> It is not showing compiler error on Codeblocks on my machine. >> >> >> On Thu, Jul 28, 2011 at 2:26 PM, prabhat wrote

Re: [algogeeks] Small Doubt

2011-07-27 Thread rajeev bharshetty
@anika : I just found out that it can be done as int *p = (int *)0x0ff ; *p=4; then 4 gets stored in 0x0ff location . Guys can it be done . Is it Legal ?? On Thu, Jul 28, 2011 at 9:11 AM, Anika Jain wrote: > segmentation fault comes when we try to modify or do illegal access to the > memory th

Re: [algogeeks] how to calculate the complexity

2011-07-27 Thread rajeev bharshetty
Masters Theorem http://en.wikipedia.org/wiki/Master_theorem On Thu, Jul 28, 2011 at 1:14 AM, NITIN SHARMA wrote: > Can anybody explain the basic steps that how to calculate the > complexity of an algo so that i would be able to find complexity of > any program > > -- > You received this messa

Re: [algogeeks] Sparse matrix

2011-07-27 Thread rajeev bharshetty
To store sparse matrix adjacency lists should be used rather than adjacency matrix ... On Thu, Jul 28, 2011 at 12:03 AM, aditi garg wrote: > How wud u store a sparse matrix( whch has elemensts only below or abv > the diagonal) in memory...what data structure u wud use and y? > > -- > You received

Re: [algogeeks] DE Shaw - Data Structure Section Qn

2011-07-27 Thread rajeev bharshetty
Hash Table with Bucket , made of linked list . At most if all n values hash to same bucket then at worst case we must traverse n linked list nodes to find the element. Hope it is clear On Wed, Jul 27, 2011 at 11:59 PM, Reynald wrote: > Which of the following data structure do better job (has l

Re: [algogeeks] C-question

2011-07-27 Thread rajeev bharshetty
The output is 10101101 consider it to be f(173) -> f(86) -> f(43) -> f(21) -> f(10) -> f(5) -> f(2) -> f(1) 1 0 110 1 01 Hope you get the recursion there . On Wed, Jul 27, 2011 at 11:19 PM, Vijay Khandar wrote: > #

Re: [algogeeks] Xplain the C code

2011-07-27 Thread rajeev bharshetty
That is because you have exceeded the character array size so i think it is providing unwanted results. To correct the program increase the size of the array a a[9] . On Wed, Jul 27, 2011 at 9:38 PM, Shantanu Sachdev wrote: > > #include > #include > int main() > { > char a[3]="mnnitald";

Re: [algogeeks] Re: MS c output ques

2011-07-27 Thread rajeev bharshetty
.instead of s as expected...can u plz point > out the error > > On Tue, Jul 26, 2011 at 11:21 PM, siva viknesh wrote: > >> @both...fantastic explanation...thanks :) >> >> On Jul 26, 10:34 pm, rajeev bharshetty wrote: >> > So if the input is gujarat it scans guj

Re: [algogeeks] Re: write an scanf that reads only a to z charchter.............

2011-07-26 Thread rajeev bharshetty
@Nithish Yup you are right :) On Wed, Jul 27, 2011 at 12:54 AM, Nitish Garg wrote: > scanf("%[^a-z]",z); will only accept characters other than a-z. > The solution must be scanf("%[a-z]", z); to read only the characters a-z. > > -- > You received this message because you are subscribed to the Goo

Re: [algogeeks] write an scanf that reads only a to z charchter.............

2011-07-26 Thread rajeev bharshetty
scanf("%[^a-z]",i); On Wed, Jul 27, 2011 at 12:43 AM, TUSHAR wrote: > write an scanf that reads only a to z charchter. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@google

Re: [algogeeks] Facebook Interview question at NIT Warangal

2011-07-26 Thread rajeev bharshetty
@Ankur The link does has a very good explanation. Nice solution :) On Tue, Jul 26, 2011 at 10:47 PM, Kunal Patil wrote: > @Ankur Garg: Nice explanation at the link given by u... > > > On Tue, Jul 26, 2011 at 10:35 PM, Ankur Garg wrote: > >> Check this >> >> http://codesam.blogspot.com/2011/03/f

Re: [algogeeks] MS c output ques

2011-07-26 Thread rajeev bharshetty
So if the input is gujarat it scans gujarat to find the first character in gujarat which is also present in india . So the character in gujarat is a so it will stop on encountering a and prints the string scanned till then. If the input is india , it matches at first location so it prints the cont

Re: [algogeeks] GATE C-Question

2011-07-26 Thread rajeev bharshetty
C ) On Tue, Jul 26, 2011 at 9:02 PM, Vijay Khandar wrote: > Consider the following C-function in which a[n] and b[m] are two > sorted integer arrays and c[n+m] be an other integer array. > > > void XYZ(int a[],int b[], int c[]) > { > int i,j,k; > i=j=k=0; > while((i { > if (a[i] c[k++]=a[i++]; >

Re: [algogeeks] Re: Graph Based Problems

2011-07-26 Thread rajeev bharshetty
DFS or BFS traversal would do to find the relationships in a network of friends . Traverse the graph and appropriately find the nodes (friends) which are at one level below in a graph(tree). As Linkedin does , it finds people connected to you at various levels of depth as people connected at degree

Re: [algogeeks]

2011-07-26 Thread rajeev bharshetty
test or text ?? On Tue, Jul 26, 2011 at 7:52 PM, kavitha nk wrote: > @saurabh::gets too could be used > > > //BE COOL// kavi > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googl

Re: [algogeeks] Closest as Possible

2011-07-26 Thread rajeev bharshetty
Sum of any number of elements on the two partitions should be as close as possible. On Tue, Jul 26, 2011 at 6:49 PM, Puneet Gautam wrote: > @rshetty: do u mean the sum of any no of elements separately in the > two partitions be equal to each other..? is that what u mean..? > > On 7/26/11, rShetty

Re: [algogeeks] C output.

2011-07-26 Thread rajeev bharshetty
Replace || by && and then j and k will get evaluated. The thing is that i think when the compiler sees a || operator ,if the first operand is true than it wont check for the second.Thus j and k are not getting evaluated. On Tue, Jul 26, 2011 at 2:46 PM, Ankur Khurana wrote: > #include > > #inclu

Re: [algogeeks] OUTPUT

2011-07-25 Thread rajeev bharshetty
@Ambika Clearly its compiler dependent , My explanation was for gcc 4.3.2 , So it Depends!!1 On Tue, Jul 26, 2011 at 7:03 AM, ambika iyer wrote: > @rajeev : in dev cpp the output is coming as 8 2 for the 2nd code :( y > is tat so??? > > > On Mon, Jul 25, 2011 at 11:30 PM, aditi garg wrote: >

Re: [algogeeks] OUTPUT

2011-07-25 Thread rajeev bharshetty
Jul 25, 2011 at 11:06 PM, aditi garg wrote: > Can u plz elaborate...im not able to understand... > > On Mon, Jul 25, 2011 at 11:04 PM, rajeev bharshetty > wrote: > >> @sameer I think that is right >> >> >> On Mon, Jul 25, 2011 at 11:02 PM, sameer.mut...@gmail

Re: [algogeeks] OUTPUT

2011-07-25 Thread rajeev bharshetty
#include main() { int i=1; printf("\n%d ",i<<=1%2); return 0; } Try only this It provides o/p as 2 so it must be side effect. On Mon, Jul 25, 2011 at 11:04 PM, rajeev bharshetty wrote: > @sameer I think that is right > > > On Mon, Jul 25, 2011 at 11:02

Re: [algogeeks] OUTPUT

2011-07-25 Thread rajeev bharshetty
@sameer I think that is right On Mon, Jul 25, 2011 at 11:02 PM, sameer.mut...@gmail.com < sameer.mut...@gmail.com> wrote: > its because of side effect where value of i is getting changed twice in a > single line. > correct me if i am wrong :) > > *Muthuraj R. > 4TH Year BE.** > Information Scienc

Re: [algogeeks] OUTPUT

2011-07-25 Thread rajeev bharshetty
@Deoki Remove the first printf from the program .. You will get 3 3 . The first printf should be removed . And about the output as 3 3 it is beacuse of the right to left eval of printf so i has value 3 after evaluation. On Mon, Jul 25, 2011 at 10:49 PM, Deoki Nandan wrote: > run on gcc compiler

Re: [algogeeks] Question

2011-07-25 Thread rajeev bharshetty
Insufficient Data ... On Mon, Jul 25, 2011 at 10:29 PM, shady wrote: > easy guys... > > @sagar nice question, if there had been an option for incomplete info, i > would have gone with that... but it made me think thoroughly :) 80 min. is > answer > > @aashish we are forming new group for apti k

Re: [algogeeks] interesting article for becoming a good programmer

2011-07-25 Thread rajeev bharshetty
@Rajeev Its Awesome dude On Mon, Jul 25, 2011 at 8:01 PM, Rajeev Kumar wrote: > > Hi friends, > Go through this link.U may find it helpful... > http://blogs.oracle.com/sandip/entry/how_to_be_a_good > > > -- > Thank You > Rajeev Kumar > > -- > You received this message because you are subscribe

  1   2   >