Re: [algogeeks] output help

2011-08-09 Thread dinesh bansal
bit to all the remaining positions making it 0x (-1). You can confirm it while setting bit.bit1 to 0 -Dinesh Bansal On Tue, Aug 9, 2011 at 12:24 PM, Rohit Srivastava access2ro...@gmail.comwrote: #includestdio.h #includeconio.h int main() { struct value { int bit1:1

Re: [algogeeks] Nagarro Coding Round Ques......

2011-07-25 Thread dinesh bansal
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you

Re: [algogeeks] Address of var

2011-07-25 Thread dinesh bansal
. 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. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received

Re: [algogeeks] Nagarro Coding Round Ques......

2011-07-25 Thread dinesh bansal
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. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's

Re: [algogeeks] output

2011-07-21 Thread dinesh bansal
. 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. -- Dinesh Bansal The Law of Win says, Let's not do it your

Re: [algogeeks] reverse a line.

2011-07-21 Thread dinesh bansal
://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Adding w/o +

2011-07-13 Thread dinesh bansal
. 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. -- Dinesh Bansal The Law of Win says, Let's not do

Re: [algogeeks] Re: Adding w/o +

2011-07-13 Thread dinesh bansal
/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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

Re: [algogeeks] Reversing the order of words in String

2011-07-13 Thread dinesh bansal
); NewWord = 0; } } ii++; } /* Now print the words from stack */ while(1) { ii = pop(); printf(%s ,(char *)InStr[ii]); if(ii == 0) break; } } -Dinesh Bansal On Wed, Jul 6, 2011 at 9:49 PM, Navneet Gupta navneetn...@gmail.com wrote

Re: [algogeeks] remove duplicate chars in a string without using extra memory

2011-07-11 Thread dinesh bansal
; } } } for(i=0; i size;i++) printf(%c,input[i]); } -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] priority inversion

2011-06-21 Thread dinesh bansal
in. Since medium priority tasks does not need R, they can interrupt L. Now if H also need the same resource R, it has to wait until L is done with it. So H gets blocked. This is called priority inversion. -Dinesh Bansal On Mon, Jun 20, 2011 at 10:35 PM, ricky moon.afr...@gmail.com wrote: In priority

Re: [algogeeks] Reverse the bits.

2011-06-11 Thread dinesh bansal
Thanks Guys I got it. @balaji... you are right.. it will work just fine. -Dinesh Bansal On Fri, Jun 10, 2011 at 10:22 PM, Vetri Balaji vetribal...@gmail.com wrote: int flip(int j,int k,int n) {   int t1=(1j)-1;   int t2=(1k)-1;   t1=t2^t1; return n^t1; } correct me if im wrong On Fri

[algogeeks] Reverse the bits.

2011-06-10 Thread dinesh bansal
How do you reverse the bits between j to k in a 32 bit integer. For e.g.: n = 11100011; j = 2 and k = 5 output: 1101 (bits from 2 to 5 are reversed.) n = 11010110; j = 1 and k = 5 output: 11101000 O(1) method is preferred. Thanks, -- Dinesh Bansal The Law of Win says, Let's not do

Re: [algogeeks] Algorithm for dynamic resource allocation

2011-05-05 Thread dinesh bansal
://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

Re: [algogeeks] Re: Algorithm for dynamic resource allocation

2011-05-05 Thread dinesh bansal
Medium | 5 Low | 2 Calculate total weight = 8*4+5*2+2*1 = 44 Now assign resource based on priority: Priority = high, Resource = 4 * 100 / 44 Priority = medium, Resource = 2 * 100 / 44 Priority= low, Resource = 1 * 100 / 44 Hope it makes more clear. -Dinesh Bansal On Thu

Re: [algogeeks] What is the error in the following function

2011-02-15 Thread dinesh bansal
type On Tue, Feb 15, 2011 at 12:36 PM, rahul rahulr...@gmail.com wrote: char *start is const char *start, pointer to const char, u can't derefernce it and change it. take a char start[256].try this. On Tue, Feb 15, 2011 at 12:31 PM, dinesh bansal bansal...@gmail.comwrote: Hi All, Can you

[algogeeks] What is the error in the following function

2011-02-14 Thread dinesh bansal
+=2,j+=2) { start[i] = hex_buf[j]; start[i+1] = hex_buf[j+1]; } } Thanks, -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] amazon c questn

2011-02-13 Thread dinesh bansal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] ThreeListSum

2011-01-11 Thread dinesh bansal
email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says

[algogeeks] Single linked list questions.

2011-01-06 Thread dinesh bansal
Hi Guys, There are some questions asked to me: 1. How do you print the SLL in reverse order. List should not be changed. 2. Two SLLs are merging at one point, how can you find out efficiently. Thanks -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best

Re: [algogeeks] Re: Single linked list questions.

2011-01-06 Thread dinesh bansal
://groups.google.com/group/algogeeks?hl=en. Hi juver++, Ya.. recurrsive function call was a good idea.. thanks. Regrading second question, there are two SLLs L1 and L2, at some node both lists nodes point to the same node and create single linked list. hope I am clear. -- Dinesh Bansal The Law of Win says

Re: [algogeeks] SUN Microsystem Question

2010-12-24 Thread dinesh bansal
. Use External sorting. Divide the file data into smaller chunks. Sort the chunks of data one at a time and save them back to file. Then get top values from the chunks and sort them again till you get top 10 values. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do

Re: [algogeeks] Adobe Interview Question

2010-12-21 Thread dinesh bansal
If we rewrite question in terms of Probability, call to foo2() depends on two events: 1. (E1) A B, probablity 75%. 2. (E2) C D, again probability 75%. Probability (E) = Prob(E1) * Prob(E2) = 75/100 * 75/100 * 5000 = 2812.50 times. Correct me if wrong. - Dinesh Bansal On Wed, Dec 15, 2010

Re: [algogeeks] plz explain output

2010-10-13 Thread dinesh bansal
/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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

Re: [algogeeks] Re: find duplicate and missing element

2010-09-01 Thread dinesh bansal
://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge

Re: [algogeeks] Re: find duplicate and missing element

2010-09-01 Thread dinesh bansal
+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because

Re: [algogeeks] Find the duplicate

2010-08-05 Thread dinesh bansal
...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you

Re: [algogeeks] All about references

2010-08-03 Thread dinesh bansal
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do

[algogeeks] Sort the data from a big file.

2009-12-21 Thread dinesh bansal
file contents in main memory. Can somebody help me with algorithm or pseudo code? Thanks in advance. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Sort the data from a big file.

2009-12-21 Thread dinesh bansal
On Mon, Dec 21, 2009 at 6:47 PM, Linus Probert linus.prob...@gmail.comwrote: If the numbers are unique you could use a bitmap-sort this way you could easily read just parts of the file at a time. If they aren't unique it gets a bit trickier. /L dinesh bansal wrote: Hi All, Suppose I

Re: [algogeeks] Re: Can you guys help me how to approach this problem !!!

2009-12-06 Thread dinesh bansal
/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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

Re: [algogeeks] Print binary tree in spiral

2009-11-19 Thread dinesh bansal
at their specific locations. At the end, display the nodes from the array. Thanks, -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: aai + bj + ck =0

2009-11-02 Thread dinesh bansal
are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do

[algogeeks] Re: minimum difference.

2009-09-02 Thread dinesh bansal
by adding an element to the set that is already there (O(n) expected time to build the set). Ralph Boland -- Dinesh Bansal The Law of Win says, Let's not do it your way or my way; let's do it the best way. --~--~-~--~~~---~--~~ You received this message because you