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 wrote: > #include > #include > > int main() > { > struct value > { > int bit1

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

2011-07-25 Thread dinesh bansal
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 th

Re: [algogeeks] Address of var

2011-07-25 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 say

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

2011-07-25 Thread dinesh bansal
ail 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

Re: [algogeeks] reverse a line.

2011-07-21 Thread dinesh bansal
uv > Saurabh Badhai > > -- > 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.

Re: [algogeeks] output

2011-07-21 Thread dinesh bansal
; > > -- > Regards > Saurabh > > -- > 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 >

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

2011-07-13 Thread dinesh bansal
never mind...thanks. On Wed, Jul 13, 2011 at 2:29 PM, dinesh bansal wrote: > Can you explain how its working? > > On Wed, Jul 13, 2011 at 1:58 PM, Anika Jain > wrote: > > a better idea is use this: > > > > int a=9,b=4; > > int sum=printf("

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

2011-07-13 Thread dinesh bansal
= ' ') NewWord = 1; } else { if(NewWord) { push(ii); NewWord = 0; } } ii++; } /* Now print the words from stack */ while(1) { ii = pop(); printf("%s ",(char *)&InStr[ii]);

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

2011-07-13 Thread dinesh bansal
s.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 >

Re: [algogeeks] Adding w/o +

2011-07-13 Thread dinesh bansal
cause 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 >

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

2011-07-11 Thread dinesh bansal
) { input[j] ^= ele; } } } 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 messa

Re: [algogeeks] priority inversion

2011-06-21 Thread dinesh bansal
. 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 wrote: > In priority inversion the h

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 wrote: > int flip(int j,int k,int n) > { >   int t1=(1<   int t2=(1<   t1=t2^t1; > return n^t1; > } > correct me if im wrong > >

[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

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] Algorithm for dynamic resource allocation

2011-05-04 Thread dinesh bansal
egroups.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

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

[algogeeks] What is the error in the following function

2011-02-14 Thread dinesh bansal
0; ((j+1) < new_len2); i+=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

Re: [algogeeks] amazon c questn

2011-02-13 Thread dinesh bansal
ail 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

Re: [algogeeks] ThreeListSum

2011-01-11 Thread dinesh bansal
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. > -- Dinesh Bansal The Law of Win says, &q

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

2011-01-06 Thread dinesh bansal
s.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 W

[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&#

Re: [algogeeks] SUN Microsystem Question

2010-12-24 Thread dinesh bansal
ttp://groups.google.com/group/algogeeks?hl=en. > > 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

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

Re: [algogeeks] help me find a solution

2010-12-09 Thread dinesh bansal
oup, 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. > > -- Dinesh Bansal The Law of Win says,

Re: [algogeeks] plz explain output

2010-10-13 Thread dinesh bansal
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 wa

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

2010-09-01 Thread dinesh bansal
> > -- > 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

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

2010-09-01 Thread dinesh bansal
thm 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. > -- Dinesh

Re: [algogeeks] Find the duplicate

2010-08-05 Thread dinesh bansal
; 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 thi

Re: [algogeeks] All about references

2010-08-03 Thread dinesh bansal
..@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 y

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 wrote: > 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: > &g

[algogeeks] Sort the data from a big file.

2009-12-21 Thread dinesh bansal
ntire 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

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

2009-12-06 Thread dinesh bansal
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

Re: [algogeeks] Print binary tree in spiral

2009-11-19 Thread dinesh bansal
n BFS manner and store the nodes in an array 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 a

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

2009-11-02 Thread dinesh bansal
ore 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

[algogeeks] find minimum number of races

2009-09-11 Thread dinesh bansal
Hi All, I got a question: I have 25 horses and I need to find the 1st, 2nd and 3rd fastest among all. I have a race course of 5 tracks. That means I can run 5 horses at a time. What are the minimum number of races required for this. Thanks, -- Dinesh Bansal The Law of Win says, "Let

[algogeeks] Re: minimum difference.

2009-09-02 Thread dinesh bansal
over a duplicate 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." --~--~-~--~

[algogeeks] algorithm to find Anagrams

2009-01-21 Thread dinesh bansal
Hi All, Can anyone provide me a good program/algorithm to find all anagrams for a given word. Input string should be of variable length (max 26 char). Just printing is not enough, we need to store the output to a file or static memory somewhere. Thanks in advance. -- Dinesh Bansal The Law of