Re: [algogeeks] Re: Amazon Job openings

2021-07-16 Thread Rahul Vatsa
It's great to see this group active after such a long time, though it was not for discussing an algo, but I think it's fine if a member in the group needs some help in his/her professional career and asks for the same here. Many members in this group are in this industry from more than a decade or

Re: [algogeeks] CAN ANYBODY HELP ME ?!! WİTH THİS ALGORİTHM

2018-11-06 Thread Rahul Rai
Let the glass be numbered 0 1 2 3... (2n - 1). And the glass numbered 0 1 2 3...(n - 1) are filled. Pick every alternating ith filled glass starting from 1 indexed glass and swap it with the (n - 1 - i)th unfilled glass. Index 1 will swap with 2n - 2 indexed glass. Index 3 will swap with 2n - 4

Re: [algogeeks] Experience hiring in siemens with 5-8 years in C\C++

2016-10-24 Thread Rahul
How much is the maximum CTC which can be offered by Simens? On Monday, October 24, 2016, Himanshu Singh wrote: > Hello All, > > Openings at Siemens Bangalore with following skill set. > 1. 5-8 years of experience. > 2. c, c++ and Embedded experience. > 3. Linux,

Re: [algogeeks] Urgent Need ITIL Service Management Operations Business/Process Analyst in Manhattan, NY for 6+ months

2015-09-09 Thread Rahul Vatsa
Please block this guy. On Thu, Sep 10, 2015 at 1:08 AM, Shaik Asif wrote: > Hi Partner, > > > > This is Shaik from Deegit Inc. Please find the below requirement for your > review. If you are comfortable with the requirement please get back to me > ASAP on

Re: [algogeeks] Urgent Need Test Lead - Performance Architect in Atlanta, GA for 6 months

2015-09-08 Thread Rahul
> >> ___ >> >> >> >> Shaik | Deegit Inc | >> >> 1900 East Golf Rd., Suite 925 | Schaumburg, IL 60173 | >> >> Ph: 847.440.2436 ext - 358 | Fax: 847.330.1987 >> >> sh...@deegit.c

Re: [algogeeks] Technology for Graphical User Interface on Linux

2014-10-18 Thread rahul
ncurses. On Friday, October 17, 2014, Mayur mayurhem...@gmail.com wrote: Not the right forum.. But you can try Qt if licensing isn't a concern. Or GTK+. On Mon, Oct 6, 2014 at 8:03 PM, sagar sindwani sindwani.sa...@gmail.com wrote: Hi all, I am looking for a good tool or language to

Re: [algogeeks] C++ initialization list

2014-09-28 Thread Rahul Vatsa
http://stackoverflow.com/questions/3127454/how-do-c-class-members-get-initialized-if-i-dont-do-it-explicitly On Sun, Sep 28, 2014 at 12:22 PM, Deepak Garg deepakgarg...@gmail.com wrote: Hi In example 1, member z will have a garbage value (i.e. 0 in your case ) Thanks Deepak On Sep 28,

Re: [algogeeks] Re: Median of two sorted arrays of different sizes

2013-06-09 Thread rahul sharma
= (sizeA + sizeB) / 2; while(max = min) { i = (min + max) / 2; j = medianPos-i; if (B[j] A[i]) min = i+1; else if (B[j+1] A[i]) max = i-1; else break; } printf(Median is %d\n, (A[i] B[j]) ? A[i] : B[j]); Don On Apr 24, 1:19 pm, rahul sharma rahul23111...@gmail.com wrote

[algogeeks] kth smallest element in 2 sorted arrays

2013-06-09 Thread rahul sharma
Please suggest logm+logn aproach... can be easily done in o(k) How to do in logm +logn plz suggest algo -- 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] A Juggling Algorithm

2013-06-05 Thread rahul sharma
Can anybody explain me how juggling algo works for array rotation ???Whats the logic behind this? -- 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

Re: [algogeeks] Re: searching all matching words in a Trie with a given filter.

2013-06-05 Thread rahul sharma
wat exaclty the question is. We have to make a tire with filter or we have a trie(whole dictionary) and we have to check filter out the elements. plz explain question On Wed, May 29, 2013 at 7:55 PM, Don dondod...@gmail.com wrote: There has to be some way to know that a node is the end of

[algogeeks] t9 dictionary

2013-06-05 Thread rahul sharma
how to implement with trie.???is trie the best way..plz provide me raw algo to start with, -- 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

Re: [algogeeks] Minimum number of coins to SUM to S

2013-06-05 Thread rahul sharma
: This seems to be Coin Change problem. Just google that. On Tue, May 28, 2013 at 12:42 AM, Adolfo Ccanto adol...@gmail.comwrote: Can you write the constraints for this problem? thanks. Adolfo 2013/5/18 rahul sharma rahul23111...@gmail.com Minimum of coins to sum s -- You received

[algogeeks] Re: t9 dictionary

2013-06-05 Thread rahul sharma
Can i implement by trie which is having structure as 9 pointers for 9 digits..like if it comes 4663...i will make a path 4663 from root to leaf and in end i will have a linked list to store dataany more optimized solution anyone having???plz suggest On Thu, May 30, 2013 at 2:37 AM, rahul

Re: [algogeeks] searching all matching words in a Trie with a given filter.

2013-05-29 Thread rahul sharma
@don u r searching in a previously built trie with the given filter...then wat is this add fxn doing?correct me if m getting u wrng On Wednesday, May 29, 2013, avinesh saini avinesh.sa...@gmail.com wrote: Thank you Don, I was also trying in similar way. But here I'm confused how you are storing

[algogeeks] Minimum number of coins to SUM to S

2013-05-27 Thread rahul sharma
Minimum of coins to sum s -- 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: count number of set bits in an (big) array (Asked in Google interview)

2013-05-27 Thread rahul sharma
guys ..i got solution here http://www.geeksforgeeks.org/program-to-count-number-of-set-bits-in-an-big-array/ plz tell how its complexity is logn. On Fri, May 17, 2013 at 6:55 PM, Don dondod...@gmail.com wrote: Counting the set bits in one integer is not the problem which was asked. However,

[algogeeks] lexographic permutations complexity

2013-05-27 Thread rahul sharma
following is code from geeks for geeks. Please tell how the complexity of this in n*n! n*n! times loop will be executed and then wat about the statements in loop?? reference:- http://www.geeksforgeeks.org/lexicographic-permutations-of-string/(second method) void reverse(char str[], int l, int

Re: [algogeeks] Re: count number of set bits in an (big) array (Asked in Google interview)

2013-05-27 Thread rahul sharma
and how this is working void init() { bitCount[0] = 0; for(int i = 1; i 65536; ++i) bitCount[i] = bitCount[i/2] + (i1); } it is working fine..but plz tell the logic behind this On Thu, May 23, 2013 at 11:12 AM, rahul sharma rahul23111...@gmail.comwrote: @don...i got it...its complexity

Re: [algogeeks] Re: count number of set bits in an (big) array (Asked in Google interview)

2013-05-27 Thread rahul sharma
@pramidathat can be done in 0(n)..lets say int takes 4 bytes i will make and array of first 256 numbers ... while finding for inte i will take a char pointer pointing to first byte and then using array of 256 int i will count in that byte and increent array and count in it.and so

Re: [algogeeks] least common ancestore bst

2013-05-27 Thread rahul sharma
it) On Mon, May 13, 2013 at 1:42 AM, rahul sharma rahul23111...@gmail.comwrote: [image: BST_LCA] what should be ancestor of 12 and 14.it should be 12 or 14...if 12 then for 20 and 22 also it is 20...if 12 ans 14 has ancestor as 8 then for 20 and 22 it is NULL. @all

Re: [algogeeks] Re: count number of set bits in an (big) array (Asked in Google interview)

2013-05-27 Thread rahul sharma
@don...i got it...its complexity is logn..how? On Thu, May 23, 2013 at 11:10 AM, rahul sharma rahul23111...@gmail.comwrote: @don..you are counting in an integer only...correct if wrng? On Wed, May 22, 2013 at 7:28 PM, Don dondod...@gmail.com wrote: My program works with any numbers. Don

Re: [algogeeks] Re: count number of set bits in an (big) array (Asked in Google interview)

2013-05-27 Thread rahul sharma
@don..you are counting in an integer only...correct if wrng? On Wed, May 22, 2013 at 7:28 PM, Don dondod...@gmail.com wrote: My program works with any numbers. Don On May 22, 3:45 am, Pramida Tumma pramida.tu...@gmail.com wrote: This above program works only if the array contains

[algogeeks] [Adobe]Generate all possible combinations (of r elements) inside an array of size N

2013-05-27 Thread rahul sharma
Generate all possible combinations (of r elements) inside an array of size N E.g. arr [] = {2,8,14} All possible combinations of r=2 will be {2,8}, {8,14}, {14,2} Asked in adobe -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe

Re: [algogeeks] least common ancestore bst

2013-05-16 Thread rahul sharma
then what is LCA On Sun, Apr 21, 2013 at 10:32 PM, Tushar Patil tushar01pa...@gmail.comwrote: @rahul : It's fine solution, but can we check the root-data == n1 || n2 before calling function recursively, I think if we check this condition 1st it will reduce unnecessary function calls. Correct me

[algogeeks] Next higher number with same number of set bits

2013-05-12 Thread rahul sharma
unsigned snoob(unsigned x) { unsigned smallest, ripple, ones; // x = xxx0 smallest = x -x; // 0001 ripple = x + smallest; // xxx1 ones = x ^ ripple; // 0001 ones = (ones 2)/smallest; // 0111 return ripple | ones; // xxx1 0111 } please

[algogeeks] count number of set bits in an (big) array (Asked in Google interview)

2013-05-12 Thread rahul sharma
I was searching for google questions and got this question.Use look up to do it in bext way What is best time complexity for this.. plz post algo too -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop

Re: [algogeeks] MS written Reasoning question

2013-05-03 Thread rahul sharma
would be MCA. So ans would be (d) option (b) is not correct as it says that only 2 mba and only 1 mca are selected but the total no of selected candidates are 6. -- Ashish On Fri, Apr 26, 2013 at 11:32 PM, rahul sharma rahul23111...@gmail.comwrote: 10 candidates appear for an interview

[algogeeks] MS written Reasoning question

2013-04-28 Thread rahul sharma
10 candidates appear for an interview and 6 selected. 2-M.A 2-MCA 4-BTECH 2-MBA. If at least one MBA is selected then exactly 2 btech are selected and vice versa. Of six candidates,exactly one must be an MA cndidate question:- which of the following statementsis definitely true:,if 2 btech are

Re: [algogeeks] Re: Find the number of islands/connected components

2013-04-26 Thread rahul sharma
AM, Don dondod...@gmail.com wrote: The complexity is still O(ROWS*COLS) because each location in the matrix will be visited once by the loop and once by DFS. Once a location has been visited by DFS, it is marked as visited and can't be visited again. Don On Apr 25, 5:11 pm, rahul sharma

[algogeeks] Re: Find the number of islands/connected components

2013-04-25 Thread rahul sharma
@don..can u plz tell me how the complexity of this http://www.geeksforgeeks.org/find-number-of-islands/ is ROW*COL? On Thu, Apr 11, 2013 at 4:35 PM, rahul sharma rahul23111...@gmail.comwrote: M not getting matrix..is it adjacencyif simple 1 means connected components then first wehave 3

[algogeeks] Re: Find the number of islands/connected components

2013-04-25 Thread rahul sharma
What will be complexity if all elements in matrix are 1.. when first dfs will call then all matrix will be scanned setting each element to visited... then again loop contiues to scan all the elements..plz explain On Thu, Apr 11, 2013 at 2:04 AM, rahul sharma rahul23111...@gmail.comwrote

[algogeeks] Median of two sorted arrays of different sizes

2013-04-24 Thread rahul sharma
IS this code correct? float findMedianUtil( int A[], int N, int B[], int M ) { // If the smaller array has only one element if( N == 1 ) { // Case 1: If the larger array also has one element, simply call MO2() if( M == 1 ) return MO2( A[0], B[0] );

Re: [algogeeks] Interview Question

2013-04-19 Thread rahul sharma
search the previous posts before posting search for [algogeeks] Amazon Interview Question you will get this -- 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

Re: [algogeeks] Re: algorithm to sort based on frequency.

2013-04-16 Thread rahul sharma
@don.can u plz explain with example. On Wed, Feb 1, 2012 at 9:29 PM, Don dondod...@gmail.com wrote: Build a hashmap with the array value as a key mapping to a struct which contains the key, frequency, and location of first occurance. Then sort the hashed elements comparing first by frequency

Re: [algogeeks] Re: algorithm to sort based on frequency.

2013-04-16 Thread rahul sharma
Can anyone give me example using hash+linked list method ..although i got dave method.but still... On Tue, Apr 16, 2013 at 8:58 PM, Dave dave_and_da...@juno.com wrote: @Varun: Here is an algorithm using sorting only: 1. Append an index onto each number, so your example becomes {{4,0},

[algogeeks] inplace m*n transpose

2013-04-12 Thread rahul sharma
in this there are permutation cycles which are used to do transpose.can anybody tell me nl = (ol x R) mod (N-1) nl- new location ol- old location N-total elements if i is current element then it will be placed at new location next = (i*r)%size; r- no. of rows please explain how it works

[algogeeks] Re: Find the number of islands/connected components

2013-04-11 Thread rahul sharma
...@gmail.com wrote: islands are five as for each cell we assume all surrounding positions to be connected... so if coordinates are (x,y) then it is connected to (x+1, y), (x-1, y), (x+1, y+1), (x-1, y+1), (x+1, y-1), (x-1, y-1), (x, y-1), (x, y+1 On Thu, Apr 11, 2013 at 9:35 AM, rahul sharma

[algogeeks] Trie | (Insert and Search)

2013-04-10 Thread rahul sharma
http://www.geeksforgeeks.org/trie-insert-and-search/ Can any body tell me what is need of checking pcrawl!=0 int the return..cant we check only its value0 to check whether its a leaf node return (0 != pCrawl pCrawl-value); -- You received this message because you are subscribed to the Google

[algogeeks] Re: Trie | (Insert and Search)

2013-04-10 Thread rahul sharma
M asking in case of DELETE from trie fxn On Wed, Apr 10, 2013 at 9:15 PM, rahul sharma rahul23111...@gmail.comwrote: http://www.geeksforgeeks.org/trie-insert-and-search/ Can any body tell me what is need of checking pcrawl!=0 int the return..cant we check only its value0 to check whether

[algogeeks] Re: Interview question

2013-04-10 Thread rahul sharma
isnt the complexity should be o(m*n*n) instead of (n*n*n) as m can be greater than n..plz comment On Wed, Apr 10, 2013 at 10:11 PM, rahul sharma rahul23111...@gmail.comwrote: http://www.geeksforgeeks.org/dynamic-programming-set-27-max-sum-rectangle-in-a-2d-matrix/ wat is complexity

[algogeeks] Re: Interview question

2013-04-10 Thread rahul sharma
in the text. On Apr 10, 4:19 pm, rahul sharma rahul23111...@gmail.com wrote: isnt the complexity should be o(m*n*n) instead of (n*n*n) as m can be greater than n..plz comment On Wed, Apr 10, 2013 at 10:11 PM, rahul sharma rahul23111...@gmail.com wrote: http://www.geeksforgeeks.org

[algogeeks] Re: Find the number of islands/connected components

2013-04-10 Thread rahul sharma
islands are 11000 01002 10022 0 30405 Don On Apr 10, 4:34 pm, rahul sharma rahul23111...@gmail.com wrote: {*1*,* 1*, 0, 0, 0}, {0, *1*, 0, 0, *1*}, {*1*, 0, 0, *1*, *1*}, {0, 0, 0, 0, 0

Re: [algogeeks] Re: Dlete Linked List

2013-04-09 Thread rahul sharma
...@gmail.com wrote: head is not even declared, so I doubt that it would compile. I believe that you want to free head, not next. On Apr 9, 11:31 am, rahul sharma rahul23111...@gmail.com wrote: Is the following code correct for linked list deletion or i need to copy head in some tem. pointer

[algogeeks] Amazon interview question

2013-04-09 Thread rahul sharma
A = {5, 3, 8, 9, 16} After one iteration A = {3-5,8-3,9-8,16-9}={-2,5,1,7} After second iteration A = {5-(-2),1-5,7-1} sum =7+(-4)+6=9 Given an array, return sum after n iterations my sol/ void abc(int arr[],n) { for(i=0;in;i++) arr[i]=arr[i+1]-arr[i]; abc(arr,n-1); } I wana ask that the

Re: [algogeeks] Re: Amazon interview question

2013-04-09 Thread rahul sharma
will be executed N times. However, I would suggest not using recursion. There is no reason to not do it iteratively. Your recursive solution has no base case so it will recurse until your computer runs out of stack space, at which point it will crash. Don On Apr 9, 2:29 pm, rahul sharma rahul23111

Re: [algogeeks] Re: Amazon interview question

2013-04-09 Thread rahul sharma
If you have any other solution ..please post that...i thnik recursion is ok with base case...we need to scan again after first iteration...?? On Wed, Apr 10, 2013 at 12:12 AM, rahul sharma rahul23111...@gmail.comwrote: i forgot to add base case..can add wen 2 elemnts are there then there sum

[algogeeks] Re: Median in stream of running integers

2013-03-24 Thread rahul sharma
state. Comapring l and r child to find maximum/minimum is only needed in prelocate down, not in prelocate up. 2013/3/24 rahul sharma rahul23111...@gmail.com And also in heapify y we r not comapring l and r chid to find maximum? On Sun, Mar 24, 2013 at 6:07 PM, rahul sharma rahul23111

Re: [algogeeks] Solution Book

2013-03-17 Thread Rahul
I s your account hacked? -- www.quora.com/rahul-rai On Mon, Mar 18, 2013 at 12:27 AM, shady sinv...@gmail.com wrote: Does anyone have solutions for Let Us C by Yashwant Kanetkar ? If yes, then please PM me. -- You received this message because you are subscribed to the Google Groups

[algogeeks] trie implementation

2013-03-14 Thread rahul sharma
Can anybody provide me to understand t9 implementation? I dnt need code..I need how to implement t9 with trie with explanation..thnx in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving

[algogeeks] Re: trie implementation

2013-03-14 Thread rahul sharma
On Thursday, March 14, 2013, rahul sharma rahul23111...@gmail.com wrote: Can anybody provide any link me to understand t9 implementation? I dnt need code..I need how to implement t9 with trie with explanation..thnx in advance -- You received this message because you are subscribed to the Google

Re: [algogeeks] [Off topic] Call for Moderators for Algogeeks

2013-03-14 Thread rahul sharma
You mean one who can provide solutions to the pending questions or some type of management of group like the type of posts and off topic?? On Wed, Mar 13, 2013 at 11:25 PM, shady sinv...@gmail.com wrote: Hi, Does anyone wants to be moderator ? We want someone who is actively participating

[algogeeks] Compiler doubt

2013-01-22 Thread rahul sharma
S-aAbB\bAaB\e A-S B-s Find follow(A) and follow(B)???explanation required??thnx in advance --

Re: [algogeeks] Re: Find all words in given character Matrix

2013-01-17 Thread rahul
are u maintaining any known list of word from dictionary , if not , it might have lots of words some of them doesn't have any meaning :-), please give clear picture of what you want to achieve. On Thu, Jan 17, 2013 at 11:49 PM, Don dondod...@gmail.com wrote: Store the word list in a trie.

Re: [algogeeks] Pointers Usage

2013-01-02 Thread Rahul
Take a look at the linux kernel . Or VLC player 's source code. You will not ask this question again. -- www.quora.com/rahul-rai On Thu, Jan 3, 2013 at 12:44 AM, atul anand atul.87fri...@gmail.com wrote: @shady : It allows us to allocate m/m dynamically ..which in itself is very big

[algogeeks] B-Tree

2013-01-01 Thread rahul sharma
IF btree is of order n,then what is min nuber of values at each node Is it floor(n/2) a I read if oreder is 5 then min values in each node is 2...SO is it floor(n/2) --

Re: [algogeeks] Pointers Usage

2013-01-01 Thread rahul
Optimization. On Wed, Jan 2, 2013 at 1:35 AM, shady sinv...@gmail.com wrote: Why do we use pointers at all considering space as a factor other than allocating memory dynamically does it have any other use ? to store an integer (int *) = 8 bytes, and while making it point to an integer

[algogeeks] DBMS gate 2012 query

2012-12-27 Thread rahul sharma
HI please explain the following question no: 2 on below link as i am not able to copy it. http://www.geeksforgeeks.org/database-management-system-set-3/ --

Re: [algogeeks] Re: adobe apti question

2012-12-16 Thread rahul sharma
PM, marti amritsa...@gmail.com wrote: Yes I feel (e) is the right option. On Sunday, December 16, 2012 11:18:57 PM UTC+5:30, rahul sharma wrote: A causes B or C, but not both F occurs only if B occurs D occurs if B or C occurs E occurs only if C occurs J occurs only if E or F occurs D

Re: [algogeeks] Re: Adobe Interview Question

2012-12-12 Thread rahul
@don , becoz this is India...and shit happens everywhere On Wed, Dec 12, 2012 at 11:48 PM, Don dondod...@gmail.com wrote: I dislike interview questions which place arbitrary restrictions on the solver. It may be a good puzzle, but it's not a good interview question. Print the numbers 1

Re: [algogeeks] Re: Largest contigious subarray with average greather than k

2012-11-26 Thread Rahul Kumar Patle
, Sachin Chitale Application Engineer SCJP, SCWCD Contact# : +91 8086284349, 9892159511 Oracle Corporation -- -- Thanks and Regards: Rahul Kumar Patle M.Tech, School of Information Technology Indian Institute of Technology, Kharagpur-721302, Indiahttp://www.iitkgp.ac.in/ Mobile No: +91

Re: [algogeeks] Re: Output

2012-11-25 Thread Rahul Kumar Patle
, Rajesh -- -- Thanks and Regards: Rahul Kumar Patle M.Tech, School of Information Technology Indian Institute of Technology, Kharagpur-721302, Indiahttp://www.iitkgp.ac.in/ Mobile No: +91-8798049298, +91-9424738542 Alternate Email: rahulkumarpa...@hotmail.com [image: Linkedin]http

Re: [algogeeks] Re: Output

2012-11-25 Thread Rahul Kumar Patle
sorry its left shift.. one mistake.. other than this ans is correct.. i have done left shift on 1 by 4 bits that why result became ~(0.1) ignore the right shift i have mentioned.. On Sun, Nov 25, 2012 at 4:48 PM, Rahul Kumar Patle patlerahulku...@gmail.com wrote: @pandey : here you

Re: [algogeeks] C o/p adobe

2012-11-16 Thread rahul sharma
No. : +91 9897073730 On Fri, Nov 16, 2012 at 9:11 AM, Rahul Kumar Dubey rkd7...@gmail.comwrote: @rahulsharma file1.c #includestdio.h extern int i;// defintion provided in this file itself extern int j; // definition provided in file2 void next() { ++i; other(); } int main() { ++i

Re: [algogeeks] C o/p adobe

2012-11-16 Thread rahul sharma
Roorkee Contact No. : +91 9897073730 On Fri, Nov 16, 2012 at 10:52 PM, rahul sharma rahul23111...@gmail.comwrote: but with adding it willl copy aalll the codewe we dont need to copy..if we declare int i in file 1...and include in file 2..then i can use it in file 2 with its extern

Re: [algogeeks] C o/p adobe

2012-11-15 Thread rahul sharma
Institute of Technology Roorkee Contact No. : +91 9897073730 On Thu, Nov 15, 2012 at 9:10 PM, rahul sharma rahul23111...@gmail.comwrote: but how can i use extern..if i simply declare a variable in file1 as int j and try to use in file2 with extern then it shows that j nit defined..how cum

Re: [algogeeks] time complexity of gcd euclid algo(recursive)

2012-11-15 Thread Rahul Kumar Dubey
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *RAHUL KUMAR DUBEY* *BTech-3rd year * *Computer Science Engineering

Re: [algogeeks] C o/p adobe

2012-11-15 Thread Rahul Kumar Dubey
; // declaration of i as extern int j=10; // j defined in file2 here which was declared as extern in file 1 void other() { ++i; printf(%d\n,i); } // end of file2.c compile both file together as rahul@rahul:~gcc file1.c file2.c rahul@rahul:~./a.out you will get the required output On Fri, Nov 16

Re: [algogeeks] Advice needed

2012-11-14 Thread Rahul Kumar Dubey
modern C does suppport bool u need to include *#includestdbool.h * header it will work fine as in C++ On Sat, Oct 27, 2012 at 3:21 AM, rahul sharma rahul23111...@gmail.comwrote: There is question asked like O/p of following in C(32 bit OS) #include iostream #includestdio.h using

Re: [algogeeks] using name space std

2012-11-14 Thread Rahul Kumar Dubey
and/or functions under a name. If you specify *using namespace std* then you don't have to put *std::* throughout your code. On Tue, Oct 9, 2012 at 7:46 PM, rahul sharma rahul23111...@gmail.comwrote: That i know..please tell me its use and need On Tue, Oct 9, 2012 at 12:05 AM, Abhishek

Re: [algogeeks] C o/p adobe

2012-11-14 Thread Rahul Kumar Dubey
@rahul it will compile perfectly well . note that you have declared j in file 1 as extern and used it and have not provided its definition any where so getting compile error. as far as functions are concerned they are external by defaullt as specified by @shobhit i am attaching your corrected

Re: [algogeeks] Re: Printing all inversions in an array

2012-11-14 Thread Rahul Kumar Dubey
this group at http://groups.google.com/group/algogeeks?hl=en. -- *RAHUL KUMAR DUBEY* *BTech-3rd year * *Computer Science Engineering * *Motilal Nehru National Institute Of Technology* *Allahabad[211004],UP.* -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] test cases

2012-11-10 Thread rahul
On Oct 17, 2012 2:46 PM, w.s miller wentworth.miller6...@gmail.com wrote: Hi, You are given N numbers. You have to perform two kinds of operations: U x y - x-th number becomes equal to y. Q x y - calculate the sum of distinct numbers from x-th to y-th. It means that the

Re: [algogeeks] output of the program with explanation

2012-11-05 Thread rahul patil
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards, Rahul Patil -- 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] Ternary operators

2012-11-01 Thread rahul sharma
there, unless you use braces, of course. In teh second case however, reason given is valid: i.e. return type of ternary operator is determined by A String and the expression 0 will be taken as address of a string location. Hence, there is no guarantee of output. On 31 October 2012 19:52, rahul

Re: [algogeeks] Ternary operators

2012-10-31 Thread rahul sharma
plz read carefully On Wed, Oct 31, 2012 at 10:18 AM, Tamanna Afroze afroze...@gmail.comwrote: sorry for my last post, i didn't look carefully at the code. I think without bracket the ternary expression is incomplete, that's why; first code doesn't compile correctly. On Wed, Oct 31, 2012

Re: [algogeeks] BIG O

2012-10-31 Thread rahul sharma
26, 2012 at 2:55 PM, rahul sharma rahul23111...@gmail.com wrote: for k=1 to n { j=k; while(j0) j=j/2; } the complexity is big o is o(nlogn) am i ryt -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Extern in c

2012-10-31 Thread rahul sharma
How actually to use extern suppose in file 1 i write code..(test_new.c) #include stdio.h #includemath.h int interest_rate =5; int main() { int test = 0; int t=5; // coutceil(log2(5));// // coutpow(2,ceil(log2(5))); getchar(); return 0; } In file 2 i write #includestdio.h

Re: [algogeeks] Re: Informatica written que : C output

2012-10-31 Thread Rahul Kumar Patle
://groups.google.com/group/algogeeks?hl=en. -- Thanks and Regards: Rahul Kumar Patle M.Tech, School of Information Technology Indian Institute of Technology, Kharagpur-721302, Indiahttp://www.iitkgp.ac.in/ Mobile No: +91-8798049298, +91-9424738542 Alternate Email: rahulkumarpa...@hotmail.com [image: Linkedin

[algogeeks] You are given two 32-bit numbers, N and M, and two bit positions, i and j.

2012-10-31 Thread rahul sharma
You are given two 32-bit numbers, N and M, and two bit positions, i and j. Write a method to set all bits between i and j in N equal to M (e.g., M becomes a substring of N located at i and starting at j). EXAMPLE: Input: N = 100, M = 10101, i = 2, j = 6 Output: N = 10001010100 Following

[algogeeks] Complicated declaration C

2012-10-30 Thread rahul sharma
void(*f)(void(*)(int*,void **),int(*)(void**,int*)); f is a fxn pointer to fxn which takes 2 args and teturn nothing 2 arguments are 1. pointer to function which returns nothing and takes 2 args one pointer to int and pointer to pointer to void 2. pointer to fxn returning int and takes 2 args

[algogeeks] Informatica written que : C output

2012-10-30 Thread Rahul Kumar Patle
() { int tmp[10] , i; int n = 0; for(i=0;i9;i++) { tmp[i]=fork(); if(tmp[i]0) break; else { //count++; printf(Hello); //printf( %d - %d \n , tmp[i], count); } } } -- Thanks and Regards: Rahul

Re: [algogeeks] Pre/Post L and r value

2012-10-30 Thread rahul sharma
. On 27 October 2012 20:09, rahul sharma rahul23111...@gmail.com wrote: But y post returns temp. object On Fri, Oct 26, 2012 at 8:18 PM, Saurabh Kumar srbh.ku...@gmail.comwrote: i++: Post increment can't be a lvalue because Post increment internally returns a temporary object

Re: [algogeeks] Re: #in macros

2012-10-30 Thread rahul sharma
-Prescan On Sun, Oct 28, 2012 at 3:28 PM, rahul sharma rahul23111...@gmail.comwrote: And when char *opername=str(oper); then o/p is operwhy behaviour is diff. in 2 cases On Sun, Oct 28, 2012 at 2:53 PM, rahul sharma rahul23111...@gmail.comwrote: #includestdio.h #include str(x) #x

Re: [algogeeks] C Macro

2012-10-30 Thread rahul sharma
Yeah its working...actually it was written in book...and i did nt compilemistake of author On Tue, Oct 30, 2012 at 12:17 PM, Vikram Pradhan vpradha...@gmail.comwrote: @rahul : dude it's working fine ...check your printf() statement you are swapping the pointers and printing

Re: [algogeeks] Re: Repeated values

2012-10-30 Thread rahul sharma
Can we modify the array???we can make index we visit as negative and then if any one already containing -ve..then its repeating On Wed, Oct 31, 2012 at 1:40 AM, Don dondod...@gmail.com wrote: Does your algorithm work if N=4 and the array is {1,1,2,2}. Don On Oct 30, 2:32 pm, arumuga abinesh

Re: [algogeeks] Re: Repeated values

2012-10-30 Thread rahul sharma
, rahul sharma rahul23111...@gmail.com wrote: Can we modify the array???we can make index we visit as negative and then if any one already containing -ve..then its repeating On Wed, Oct 31, 2012 at 1:40 AM, Don dondod...@gmail.com wrote: Does your algorithm work if N=4 and the array

Re: [algogeeks] C Macro

2012-10-29 Thread rahul sharma
pointerssplz comment On Sun, Oct 28, 2012 at 9:16 PM, rahul sharma rahul23111...@gmail.comwrote: its now doing swapping of pointers...plz explain On Sun, Oct 28, 2012 at 8:08 PM, atul anand atul.87fri...@gmail.comwrote: it should swap On 10/28/12, rahul sharma rahul23111

Re: [algogeeks] C Macro

2012-10-29 Thread rahul sharma
the address of x and y in temp pointers i.e int *p.*q; p=x; q=y; int t; t=*p; *p=*q; *q=t; now you can convert it into macro. On 10/29/12, rahul sharma rahul23111...@gmail.com wrote: @atul...mistakenly i have put w at place of t in my last

[algogeeks] C Macro

2012-10-28 Thread rahul sharma
Why the following code is not able to swap two macros???although it is easily swapping 2 variables #includestdio.h #define swap(a,b,c) c t;t=a,a=b,b=t int main int x=10,y=20; int *p,*q; swap(x,y,int); -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: #in macros

2012-10-28 Thread rahul sharma
And when char *opername=str(oper); then o/p is operwhy behaviour is diff. in 2 cases On Sun, Oct 28, 2012 at 2:53 PM, rahul sharma rahul23111...@gmail.comwrote: #includestdio.h #include str(x) #x #define Xstr(x) str(x) #define oper multiply int main() { char *opername=Xstr(oper

[algogeeks] Re: LCA in BST

2012-10-28 Thread rahul sharma
if wrng On Sun, Oct 28, 2012 at 9:40 PM, rahul sharma rahul23111...@gmail.comwrote: According to wiki http://en.wikipedia.org/wiki/Least_common_ancestor n1 is parent of n2 then n1 is lcabut according to above algo return -1..i have taken it from(http://www.geeksforgeeks.org/archives/1029

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread rahul sharma
which will take you to the top right most corner. All possible arrangements = (3+3)! / (3! * 3!) In general: (m+n)! / (m! * n!) for a mxn grid. On 27 October 2012 11:05, rahul sharma rahul23111...@gmail.com wrote: should i take it how many ways are there to reach from start to the top

Re: [algogeeks] Pre/Post L and r value

2012-10-27 Thread rahul sharma
be used only as a rvalue. ++i: whereas, in Pre-increment value gets incremented and the same location is returned back to you, hence can be used as lvalue in an expression.(C++ allows this) Both can be used as rvalues though. On 26 October 2012 18:54, rahul sharma rahul23111...@gmail.com wrote

Re: [algogeeks] Sequence Point C with postincremented

2012-10-27 Thread rahul sharma
is 0) *0 1* = 0 (which gets assigned to j) Hence, j = 0, a = 1 On 26 October 2012 18:54, rahul sharma rahul23111...@gmail.com wrote: Guys plz tell that postincremented variable is incremented after sequence or after ; as we have || comma and ; as sequence point so say we have int i=10

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread rahul sharma
can we do like this? On Sat, Oct 27, 2012 at 8:04 PM, rahul sharma rahul23111...@gmail.comwrote: ..i under stand with 6!/(3!*3!) method... plz explain from combination point of viewi didnt get ur last linei understand that we need to find no. of permutaions of abcxyz s.t abc

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread rahul sharma
@payalplz explain how to slect 3 spaces for a.b.c out of 6. we need to put them in orderso look my aboyve post and plz comment On Sat, Oct 27, 2012 at 8:14 PM, rahul sharma rahul23111...@gmail.comwrote: plz help mei am thinking this the following way.. we need to find

Re: [algogeeks] Fork in c

2012-10-27 Thread rahul sharma
On Sat, Oct 27, 2012 at 2:22 PM, rahul sharma rahul23111...@gmail.comwrote: int main() { printf(text1); fork(); printf(text2\n); return 0; } the output is: text1text2 text1text2 Please explain o/p -- You received this message because you are subscribed

[algogeeks] Pre/Post L and r value

2012-10-26 Thread rahul sharma
why pre inc. is l value and post is r value..please explain -- 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] BIG O

2012-10-26 Thread rahul sharma
for k=1 to n { j=k; while(j0) j=j/2; } the complexity is big o is o(nlogn) am i 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

  1   2   3   4   5   6   7   8   9   >