Re: [algogeeks] Openings in Flipkart BLR

2015-09-05 Thread arun tiwari
On Tue, Sep 1, 2015 at 9:37 PM, Sachin Chitale wrote: > Hi folks, > > There are following open position in flipkart if someone is interested do > send your resume. > > 1. SDE2/SDET 2/UI2 (2+ yrs) > 2. APM/PM/EM > 3. Engineering Directors > 4. Architect > 5. Data Scientist > > Regards, > Sachin >

[algogeeks] Fwd: PM Modi's touching tribute to Dr APJ Abdul Kalam

2015-07-29 Thread ARUN M Shankar

[algogeeks] Renaming namespaces c++

2013-07-30 Thread Arun Vishwanathan
with Someclass automatically now referring to the updated namespace due to the typedef? Am I missing something here? Arun -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails fro

[algogeeks] why does this work?

2013-07-18 Thread Arun Vishwanathan
it gives me segv which I would expect. However if I do something as *temp=5; it does not segv. How does this happen? If it was a NULL pointer it cannot dereference it right? Arun -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsub

[algogeeks] how to solve this?

2013-04-04 Thread arun kumar
Given an expression in the form of a string, solve for x. The highest power of x in the expression will be equal to 1. Operators allowed are +, * and -. These are all binary operators. So, 2x would be written as 2*x. Every operator will be followed by a single term or a constant. For example, cons

[algogeeks] Re: Amazon Interview Questions

2013-02-13 Thread arun singh chauhan
Kindly post one question at a time otherwise it will become messy and people will get confused which solution belongs to which question. Thanks On Saturday, February 9, 2013 2:45:35 PM UTC+5:30, Pratik Mehta wrote: > > Hi All, > I need ur help in solving few questions. > > Would you please help m

Re: [algogeeks] Re: Amazon Interview Question

2013-02-13 Thread arun singh chauhan
@Sachin Chitale : Very good approach dude . thumbs up +1 -- Arun Singh Chauhan Engineer (RnD 2), Samsung Electronics Software Engineering Lab, Noida On Tuesday, February 12, 2013 11:44:08 PM UTC+5:30, Sachin Chitale wrote: > > use ex-or operation for all array elements.. > a^a=0

Re: [algogeeks] Pointers Usage

2013-01-03 Thread Arun Vishwanathan
@atul/shady: why is it that pointer takes 8 bytes ? So the takes a memory location whose value is the address of the element it points to. Why does the pointer value have to take 8 bytes? I am sorry if I am missing something silly here. On Thu, Jan 3, 2013 at 3:11 AM, Debabrata Das < debabrata.ba

Re: [algogeeks] Re: parameters to non-const and const reference concept-C++

2012-12-23 Thread Arun Vishwanathan
@Lucifer: Thanks a lot for the explanation On Sun, Dec 23, 2012 at 4:51 AM, Lucifer wrote: > @phoenix > > The reason is not an implication of using references. > If u are passing emptyvec() as an argument then the vector returned by > emptyvec() is a temp object ( as its not being assigned to a

[algogeeks] parameters to non-const and const reference concept-C++

2012-12-22 Thread Arun Vishwanathan
Hi, Could someone explain the logic behind the following: "Arguments that correspond to non-const reference parameters must be lvalues-that is they must be non-temporary objects. Arguments that are passed by value or bound to a const reference can be any value" Suppose a function returns an empt

[algogeeks] Array Problem

2012-11-15 Thread Arun Kindra
Given an unsorted array, how to divide them into two equal arrays whose difference of sum is minimum. -- 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 gr

Re: [algogeeks] Problem

2012-11-01 Thread Arun Kindra
@prankur can we do in this manner, first find the middle of the array and make it as a root, and call recursively from 0 to mid-1 for left subtree and mid+1 to len-1 for right subtree..? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post

[algogeeks] Problem

2012-10-31 Thread Arun Kindra
Ques - * struct node { int parentValue; int childValue; }str[10]; how to construct a BT,given an array of structure containing parent and child value. * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to al

Re: [algogeeks] finding element in array with minimum of comparing

2012-10-08 Thread Arun Vishwanathan
@Dave: Nice solution. Can you clarify why you need to store the first element in a temp variable and put 'elem' in the first position? If elem was already first in array then it makes no difference. If elem was not first but somewhere in between, the loop will break there when coming from behind an

[algogeeks] Matrix Searching

2012-09-14 Thread Arun Kindra
*You have given any n*n matrix in which characters are stored and you have to search that a given word is present or not.(words can be horizontally, vertically, diagonally)* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this grou

[algogeeks] Snapdeal Paper Pattern

2012-08-22 Thread Arun Kindra
Anyone know the paper pattern or ques of snapdeal? And What they demand(any specific language)? -- Regards: *Arun Kindra* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegrou

Re: [algogeeks] question

2012-08-21 Thread Arun Kindra
a) count total no of bit set in given no b) increment the given no by one and count the no of bit set in it if it equal to the above count then return else increment the no till u get the count equals the above one. -- You received this message because you are subscribed to the Google Groups "Al

Re: [algogeeks] Indus Valley Partners Paper Pattern

2012-08-20 Thread Arun Kindra
Is it for campus recruitment process or Off campus? And can u specify the Apti topic, and is there any analytical reasoning? If possible plz share Coding ques. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email

[algogeeks] Indus Valley Partners Paper Pattern

2012-08-18 Thread Arun Kindra
Can anyone know Indus Valley Partners Paper Pattern and ques? -- 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] MICROSOFT QUESTION

2012-08-17 Thread Arun Kindra
http://geeksforgeeks.org/forum/topic/algorithm-15?replies=6#post-39220 -- 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+u

Re: [algogeeks] Constant time solution needed

2012-08-12 Thread Arun Kindra
@Vicky, but it is better than ur sol, ur sol take space of O(n2) if u r not modifying the same array, and also to build the sum array it take O(n2) time. And Can u elaborate how u make this sum array? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks"

Re: [algogeeks] Constant time solution needed

2012-08-12 Thread Arun Kindra
*within -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group

Re: [algogeeks] Constant time solution needed

2012-08-12 Thread Arun Kindra
You can traverse in spiral order and add each element with the specified co-ordinate. -- 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

[algogeeks] Data Structure Real World examples

2012-08-12 Thread arun
Can anyone pls share some real world examples for each datastructure nd sorting algos.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/cxuwSiqTuuIJ. To po

Re: [algogeeks] DE Shaw written test

2012-08-05 Thread Arun Kindra
@harsha : yes, the problem is if u r finding only min and max value, it might happen that u sell the stock before buying. Ex- int a [ ] = { 5, 10, 4, 6, 7 }; the min value is 4 and max is 10 and 10 comes before 4, means u sell the stock before buying. and i think the sol given by mukul does the sa

Re: [algogeeks] national instruments on campus interview procedure

2012-08-04 Thread Arun Kindra
http://www.krishnabharadwaj.info/national-instruments/ -- 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...@googl

Re: [algogeeks] what will be output for this program ?

2012-07-27 Thread Arun Kindra
compiler dependent -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more option

Re: [algogeeks] Re: absolute minimum difference

2012-07-27 Thread Arun Kindra
@Dave Sir : Sir if u sort the array(given above) the array would be: -20,-8-2,4,9,10,12,14,17, and according to ur suggestion, the only ans is {9,10}...but one of the ans {9,-8} is also possible...as he is asking the difference in absolute values. correct me if i m wrong... -- You received t

Re: [algogeeks] Re: Finding the repeated element

2012-07-23 Thread Arun Kindra
This will help u http://www.geeksforgeeks.org/archives/570 -- 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.

[algogeeks] Datastructure and algorithms book

2012-06-05 Thread arun prakash
Can anyone pls mail me good datastrucutre and algo books..or any link to download those books..thanks in advance -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algog

Re: [algogeeks] GPU doubt

2012-04-08 Thread Arun Vishwanathan
Thanks IIya On Sat, Apr 7, 2012 at 3:53 PM, Ilya Albrekht wrote: > I'm absolutely didn't get your explanation... What is the connection > between O(n^3) algorithms and staff you are talking about? > > > On Saturday, 7 April 2012 03:22:29 UTC-7, SAMMM wrote: >> >> This is becoz the GPU is multithr

Re: [algogeeks] GPU doubt

2012-04-07 Thread Arun Vishwanathan
@SAMM: what about general mathematical computations such as matrix multiplication which is O(n^3) as such? How do you relate your explanation to such math computations or any algorithm of atleast O(n^3)? On Sat, Apr 7, 2012 at 3:22 AM, SAMM wrote: > This is becoz the GPU is multithreaded . In gr

[algogeeks] GPU doubt

2012-04-06 Thread Arun Vishwanathan
Hi, In one of lectures that I attended on cuda, I was told that GPU is better than CPU for algorithms of atleast O(n^3). How could this be understood better? Anybody? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, se

[algogeeks] binary search tree over btree

2012-04-01 Thread arun kumar
hi i just like to know when you will go for binary search tree over btree. advantage and disadvantage, application of both of them. thank you in advance Regards, Arun kumar -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To po

Re: [algogeeks] hadoop anyone?

2012-03-31 Thread Arun Vishwanathan
@karthikeyan: Thanks again but I was looking to find that information out from writing code to do so than to use a command on the command line prompt.Any idea? On Sat, Mar 31, 2012 at 10:40 AM, Karthikeyan V.B wrote: > @bharat : hadoop has a* job tracker* which *resolves the dependencies*and > *s

Re: [algogeeks] hadoop anyone?

2012-03-31 Thread Arun Vishwanathan
@karthikeyan: Thanks for that info. So in the sample wordcount program using Hadoop pipes in c++ if i want to see data each node has got, I shd query namenode? Is namenode a class or something which contains information or which variable should I check out? Thanks On Sat, Mar 31, 2012 at 2:23 AM,

[algogeeks] hadoop anyone?

2012-03-29 Thread Arun Vishwanathan
Hi all, Has anyone worked on Hadoop before? I ran the wordcount program with Hadoop but I am unable to understand how to find out which node in the cluster got which data? Any experts out here who can suggest? Arun -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: need suggestions

2012-03-28 Thread Arun Vishwanathan
dancy for some processors to finish early and > sit idle while one or two take longer to finish their portion of the > work. > > Don > > On Mar 28, 9:51 am, Arun Vishwanathan wrote: > > @Don: I am not clear with your explanation. Please can you give me an > > example?

Re: [algogeeks] Re: need suggestions

2012-03-28 Thread Arun Vishwanathan
subset of remaining items. Each processor should be able > to work fairly independently, and when they are done, they can compare > results and find the best one. > Don > > On Mar 27, 10:47 pm, Arun Vishwanathan wrote: > > Hi all, > > > > I am planning to implement a para

[algogeeks] need suggestions

2012-03-27 Thread Arun Vishwanathan
dependencies due to recursion? Is there an effective strategy for this?? Using shared memory or message passing approach? Arun -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegrou

Re: [algogeeks] Re: optimisation

2012-03-05 Thread Arun Vishwanathan
a sample and I think I got somewhat good speedup for block size 32 ( for matrix dimension 512, 1024 etc )for my L1 of size 16 kbytes and L2 256 kbytes...Any comments or inferences? On Wed, Feb 29, 2012 at 9:31 AM, Arun Vishwanathan wrote: > @all: Thanks a lot > > > On Wed, Feb 29, 201

Re: [algogeeks] Re: optimisation

2012-02-29 Thread Arun Vishwanathan
possible orderings for > the best one. Of course you also have to zero out the sums in the > best possible manner. > > FWIW, a GPU will normally outperform a general purpose CPU with ease > on this problem. Since even cell phones are getting GPUs these days, > tweaking single-pr

[algogeeks] optimisation

2012-02-27 Thread Arun Vishwanathan
had tried a bit of block tiling but was not successful. Thanks Arun -- 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: suggestions?

2012-02-12 Thread Arun Vishwanathan
nical design tools, CGI, and computer games). > > > On Feb 12, 10:58 am, Arun Vishwanathan wrote: > > hi, > > > > I need to a final project in a course called Parallel Programming. Does > > anyone have suggestions for a good topic to take up in this??Some > >

[algogeeks] suggestions?

2012-02-12 Thread Arun Vishwanathan
hi, I need to a final project in a course called Parallel Programming. Does anyone have suggestions for a good topic to take up in this??Some challenging problem maybe that is computationally intensive but can benefit from multicore and parallel processing. Thanks! -- "People often say that m

Re: [algogeeks] openmp

2012-02-05 Thread Arun Vishwanathan
sors do you have > try running without asking number of threads > .you must see as many outputs as number of processors > > > On 2/6/12, Arun Vishwanathan wrote: > > I use g++ > > > > On Sun, Feb 5, 2012 at 12:39 PM, Rahul wrote: > > > >> which c

Re: [algogeeks] openmp

2012-02-05 Thread Arun Vishwanathan
I use g++ On Sun, Feb 5, 2012 at 12:39 PM, Rahul wrote: > which compiler > or which environment > I use Microsoft Visual Studio > with Microsoft HPC Pack > A syntax error is visible > use { > > > On 2/6/12, Arun Vishwanathan wrote: > > hi , i am trying to run t

[algogeeks] openmp

2012-02-05 Thread Arun Vishwanathan
hi , i am trying to run this small code with open mp but I dont see any threads created . The code compiles with -fopenmp but does not create threads to run parallel.For example, main() { omp_set_num_threads(4); #pragma omp parallel printf(" hello world from %d\n" ,omp_get_thread_num()); retur

[algogeeks] java help

2012-02-02 Thread Arun Vishwanathan
Hi, does anybody know how to take a screenshot of screen with java ? I also need help regarding storing the screenshot image into a doc file or so. Any suggestions? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send

[algogeeks] Mathematical formula

2012-01-28 Thread Arun Vishwanathan
I wanted to gather some analysis on parallelism for matrix multiplication. Amdahl 's law essentially compares speed when work is done serially to speed when some parallelism is introduced in the system. Say I have Tcount threads used for computation on a system having NCores number of cores. Say d

Re: [algogeeks] MS Question -Reverse a Linked List in size of 2

2012-01-23 Thread Arun Vishwanathan
node *ptr =head; //function call is reverse(head,NULL) void reverse(node *ptr, node *follow) { if(ptr->next!=NULL && ptr->next->next!=NULL) reverse(ptr->next->next,ptr); else if(ptr->next!=NULL && ptr->next->next==NULL) { ptr->next->next=follow; head=ptr; } ptr->ne

Re: [algogeeks] Re: Generate all possible binary trees given in-order traversal

2012-01-22 Thread Arun Vishwanathan
@lucifer: my bad ...thanks a lot On Sun, Jan 22, 2012 at 4:27 PM, Lucifer wrote: > @Arun.. > > I think you are generating the bin-tree for ' i =startIndex' and not ' > i =startIndex +1'.. > > Hence, if you just trace it for ' i =startIndex + 1'

Re: [algogeeks] Re: sort 2D array

2012-01-22 Thread Arun Vishwanathan
@ lucifer: thank you ! On Sun, Jan 22, 2012 at 4:12 PM, Lucifer wrote: > @Arun, > > Nope.. the loop exits only when there are no more swaps possible... > > Let me explain with an example.. > x b c > d e f > g h i > > say x > min(b,d) , where min(b,d) = b

Re: [algogeeks] Re: Generate all possible binary trees given in-order traversal

2012-01-22 Thread Arun Vishwanathan
so on.. am sorry if it sounds silly...can u clarify if am seeing it wrong?? On Sun, Jan 22, 2012 at 3:31 PM, Lucifer wrote: > @Arun.. > > Are you referring to the following condition in 'GenerateBT': > /* > if ( startIndex > endIndex) return NULL; > */ > >

Re: [algogeeks] Re: sort 2D array

2012-01-22 Thread Arun Vishwanathan
t 3:25 PM, Lucifer wrote: > @Arun > > If you read the post in which i have explained the process properly, > the following is also present: > > while(1) > { > If x <= min (b,d ), > /* here b is nothing but the element placed next to 'x' on the same > ro

Re: [algogeeks] Re: Generate all possible binary trees given in-order traversal

2012-01-22 Thread Arun Vishwanathan
@lucifer: in yr code will not all the root->left be NULL for each iteration as startindex is always greater than endindex ( i.e i-1) in the recursive function call??and so for each node only root->right is made? On Fri, Dec 30, 2011 at 12:51 AM, praveen raj wrote: > yes... right... > i forget to

Re: [algogeeks] Re: sort 2D array

2012-01-22 Thread Arun Vishwanathan
@lucifer:nice explanation !... just to make a small clarification, in your stabilisation part u jus compare x with min (b,d) , make a swap if necessary and then next time u compare it shud be <=min(b,d) and so u break. x b c d e f g h i so now after breaking x is less than both b a

Re: [algogeeks] segment tree

2012-01-21 Thread arun kumar
this link deal with applying lazy propagation for the problem LITE in spoj. hope this one help you http://apps.topcoder.com/forums/?module=Thread&threadID=690098&messageID=1298729&mc=8&view=tree#1298729 regards arun On Sat, Jan 21, 2012 at 6:10 PM, UTKARSH SRIVASTAV wrote: > H

Re: [algogeeks] Re: vertical level sum in Binary tree

2012-01-21 Thread Arun Vishwanathan
no jst thinking if any practical application of this sort of thing..:) On Sat, Jan 21, 2012 at 3:11 PM, UTKARSH SRIVASTAV wrote: > why arun? > > > On Sun, Jan 22, 2012 at 1:44 AM, Arun Vishwanathan > wrote: > >> my god why do companies question like this??? >> >

Re: [algogeeks] Re: vertical level sum in Binary tree

2012-01-21 Thread Arun Vishwanathan
my god why do companies question like this??? On Sat, Jan 21, 2012 at 4:10 AM, UTKARSH SRIVASTAV wrote: > yes atul I wanted to say only that may be not able to convey it . n is > maximum number of vertical lines sum that you can calculate > > On 1/21/12, atul anand wrote: > > @ UTKARSH : how wil

Re: [algogeeks] Re: Divisibility by five

2012-01-21 Thread Arun Vishwanathan
>> determining divisibility by 5? >> >> Dave >> >> On Jan 21, 9:25 am, karthikeyan muthu >> wrote: >> > @dave >> > >> > int no=10; >> > char ans[100]; >> > sprintf(ans,"%d",no); >> > cout<>

Re: [algogeeks] Re: google questions

2012-01-21 Thread Arun Vishwanathan
@all: how is the problem solved using a heap...can someone explain. did not understand what was on the net... On Thu, Feb 3, 2011 at 2:23 AM, Avik Mitra wrote: > I am proposing a solution for problem 2.. > >2. > > Given a text file, implement a solution to find out if a pattern > > similar to wi

Re: [algogeeks] Re: distinct substring

2012-01-21 Thread Arun Vishwanathan
@juver: further explanation? On Tue, Jan 25, 2011 at 6:27 AM, juver++ wrote: > suffix trees. > > -- > 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

Re: [algogeeks] Re: Divisibility by five

2012-01-21 Thread Arun Vishwanathan
@dave or anyone: can u pls explain the logic of n&3 in dave's solution? why is it subtracted from n(which is divided by 4 using >>2) and what does n& 3 indicate? On Sat, May 7, 2011 at 9:38 AM, Dave wrote: > @Umer: Do you suppose that you can convert an int into a string > without using division

Re: [algogeeks] how to convert a floating point number into binary representation.

2012-01-21 Thread Arun Vishwanathan
@immanuel: in this part while (decimalPart > 0 && decimalPart < 1 && str.length < 64) { decimalPart *= 2; str[str.length] = (decimalPart - 0) + '0'; } is this decimalPart-0 correct here? if decimalpart (say) starts as 0.584 then after doing that into 2 we 1.164. What happe

Re: [algogeeks] Re: Amazon - Longest palindrome in a string in O(n)

2012-01-19 Thread Arun Vishwanathan
@varun : isn't the longest common subsequence abccba and longest common substring is abc or cba?in any case what is the longest palindrom in the given string abcdecba?? isnt it the individual letters itself ie length max is 1? On Wed, Jun 22, 2011 at 10:45 AM, varun gupta wrote: > That is what a

[algogeeks] anybody having K and R ebook?

2012-01-19 Thread Arun Vishwanathan
hey sorry if it seems offtopic to post here...but does anybody have an ecopy of this book?I tried searching but cudnt find one properly. thanks in advance! -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to

Re: [algogeeks] Explanation

2012-01-19 Thread Arun Vishwanathan
@all: I have a basic doubt here...does not copying of zero character to string behave as null character?..meaning shuld not printf give an empty string when i tried printing str itself since first character is now '0' ?? am confused ! On Sat, Jul 9, 2011 at 1:05 AM, oppilas . wrote: > There are

Re: [algogeeks] Re: adobe written round que

2012-01-18 Thread Arun Vishwanathan
@all : doesnt sudhir's solution seem to work?? @sudhir: can u explain yr logic? On Wed, Sep 21, 2011 at 8:31 AM, annarao kataru wrote: > can u explain the logic behind this > > thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "Algorit

[algogeeks] MS question

2012-01-18 Thread Arun Vishwanathan
Given large number of elements. All elements belong to range 1 to 27000. First case no elements repeated and second case elements are repeated. memory capacity is 4k. How to sort efficiently? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To

Re: [algogeeks] Re: Sorting for large data

2012-01-18 Thread Arun Vishwanathan
@ all : can someone provide me a good link to reading on external sort? and k way merging? is this also a useful way to sort when the number of records is large compared to memory size but many entries in the records are repeated elements? On Tue, Jan 17, 2012 at 6:42 AM, sravanreddy001 wrote: >

Re: [algogeeks] Re: String passing

2012-01-03 Thread Arun Vishwanathan
if instead of passing "hello" directly to function if we passed char array p then this would not show as an error right? and why is this so? is it due to the fact tat p array was not possibly allocated in the read only segment of memory and hence when passed it can be modified by function? so if co

Re: [algogeeks] Explanation

2012-01-03 Thread Arun Vishwanathan
@Vrashabh: yea the explanation is kinda difficult to follow since f(1,2) is once done first and once is not though the expressions look similarcan u pls explain what decides the order of evaluation here On Mon, Aug 29, 2011 at 6:23 AM, kartik sachan wrote: > see the out put will the help of g

Re: [algogeeks] C output????

2012-01-03 Thread Arun Vishwanathan
actually is there any reason as to why same address is returned to the pointer when both pointers(p and q) are initialised to "persons" unlike when p[] and q[] ="persons"? On Tue, Sep 6, 2011 at 9:08 AM, Sandy wrote: > String constants (literals) are saved into the .data section of the > program

Re: [algogeeks] Re: Doubt in C++

2012-01-03 Thread Arun Vishwanathan
@lucifer: thanks ! On Tue, Jan 3, 2012 at 9:02 AM, Lucifer wrote: > @Arun... > > Basically what u have asked boils down to 2 questions... > > 1. First, this sort of assignment requires single parameterized > constructor ? > > Yes ( and No as well in special cases.). >

Re: [algogeeks] Re: sqrt function...

2012-01-03 Thread Arun Vishwanathan
@gene: I checked the wiki link given..In that it is mentioned that initial root is chosen as 2.10^n or 6.10^n based on the number of digits being even or odd in the number. The concept of choosing 2 or 6 in this formula is based on some geometric mean concept mentioned. Can you please clarify what

Re: [algogeeks] Re: Doubt in C++

2012-01-03 Thread Arun Vishwanathan
mplicit converter as well.. > and a 'string' class has a constructor 'string(char *)', it will use > 'string(char*)' constructor to construct a temporary intermediate > string object which will hold the value 'test' and then assign to > s2... >

Re: [algogeeks] Doubt in C++

2012-01-02 Thread Arun Vishwanathan
I just have a basic doubt..does the string s1,s2 statement call any default constructor?or is it that it is not performed since parameterised constructor is present? On Wed, Sep 21, 2011 at 1:31 AM, vijay singh wrote: > It is because of the presence of the single parameterised constructor in > th

Re: [algogeeks] Amazon Interview Question

2012-01-02 Thread Arun Vishwanathan
also I dont think that for case 0 we do not need to have one ++. I guess it fails for this example 2200101 On Mon, Jan 2, 2012 at 5:36 PM, Arun Vishwanathan wrote: > @utkarsh: in yr code it shud be two-- after the swap function and not > before for case 2 > > > On Thu, Nov 10,

Re: [algogeeks] Amazon Interview Question

2012-01-02 Thread Arun Vishwanathan
@utkarsh: in yr code it shud be two-- after the swap function and not before for case 2 On Thu, Nov 10, 2011 at 1:25 PM, UTKARSH SRIVASTAV wrote: > > > sorry it was incomplete > > > On Fri, Nov 11, 2011 at 2:53 AM, UTKARSH SRIVASTAV < > usrivastav...@gmail.com> wrote: > one = zero = 0; > two = n-

Re: [algogeeks] Re: convert into palindrome

2012-01-02 Thread Arun Vishwanathan
@lucifer: can you please give a small example and explain? " Now, all we need to do is sequentially access the list and do the following: Given 2 pairs (xi, yi) and (x i+1, y i+1), We will insert RevStr(yi .. y i+1) , excluding the extreme chars, just before Str(x i+1)..." On Fri, Dec 16, 2011 at

Re: [algogeeks] Sum of Four Numbers in an Array (Amazon)

2012-01-01 Thread Arun Vishwanathan
does this make sense? 1)sort array O(nlogn) 2)keep 4 pointer to last 4 elements of array. At each point in the algorithm we need to ensure than i wrote: > sort(arr); > min=arr[0]+arr[1]+arr[2]+arr[3]; > max=arr[n-1]+arr[n-2]+arr[n-3]+arr[n-4]; > > for(i=0;i { > a=arr[i]; > k=i+1; > l=n-1; > m

Re: [algogeeks] Re: given a stream of numbers FIND MEDIAN

2011-12-26 Thread Arun Vishwanathan
@lucifer: can you explain to me in the current median calculation why if there is a Diff =1 or -1 you are using M and top(maxh) or M and top(minh) for median calculation. If the number of elements from the stream so far is odd then median is just one element and not average of 2 elements right? O

Re: [algogeeks] Re: Reverse n-Ary Tree and Return List of Leaf Nodes as Output - FYI Google MV

2011-12-22 Thread Arun Vishwanathan
@atul: can you explain what this is doing? for(i=0;ichildren[i],NULL); if(pre) { pre->children[i]=root; } } when u do tree reversal I see that child points to parent( basically direction reversed). Now if 1

Re: [algogeeks] Return index of first mismatch bracket "(" or ")"

2011-12-20 Thread Arun Vishwanathan
@shady: I guess first mismatch means the innermost open brace that doesnt have a close brace. U cannot know that the first brace does not have a closing one unless u look at the entire string. On Tue, Dec 20, 2011 at 9:23 AM, shady wrote: > ( ( ) ( ( ) ( ( ) ) ( ) for this SAMM faulty index is

[algogeeks] ACM-ICPC Kanpur 2011 LCM Extreme

2011-12-18 Thread arun kumar
long long function( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i+1; j <= n; j++ ) res+=lcm(i,j); return res; } N<=5*10^6 and TestCases<=25000.. TimeLimit=5s Can anyone give hints to solve this ? Thanks in advance ! -- You receive

Re: [algogeeks] find numbers if pair wise sums are given

2011-12-13 Thread Arun Vishwanathan
how is the case taken of when 2 pairs add to the same sum?... On Tue, Dec 13, 2011 at 11:35 AM, atul anand wrote: > hmmm i guess i screwed by taking least element as a part of the output set > directly. > > > > > On Wed, Dec 14, 2011 at 12:57 AM, sayan nayak wrote: > >> @atul: >> Suppose the inpu

[algogeeks] median from continuous stream

2011-11-08 Thread Arun Vishwanathan
Hi to find running median from a stream of random generated numbers I have heard of the 2 heap ( min and max heap ) solution but I fail to understand it...could someone please explain with a small example or so ?? thanks! -- "People often say that motivation doesn't last. Well, neither does bat

Re: [algogeeks] Re: Searching In a large file

2011-10-29 Thread Arun Vishwanathan
can someone give me a short explanation of Dave solution? I understand that a[n%10] < 1 is trying to find the bin which has less than what maximum numbers it can hold and the bin is such that all numbers counted in this have the same remainder when divided by 10. I do not get the a[n/10

Re: [algogeeks] Re: finding anagrams in file

2011-10-18 Thread Arun Vishwanathan
also what would be a suitable hash function for the string? On Tue, Oct 18, 2011 at 1:21 PM, Arun Vishwanathan wrote: > Hmm I see but if there are m max letters in each word and there are n words > in the file, then each word sort is O(mlogm) and for n words so wont it be > O(nmlogm)?

Re: [algogeeks] Re: finding anagrams in file

2011-10-18 Thread Arun Vishwanathan
Hmm I see but if there are m max letters in each word and there are n words in the file, then each word sort is O(mlogm) and for n words so wont it be O(nmlogm)? On Tue, Oct 18, 2011 at 12:55 PM, WgpShashank wrote: > Sort the all the string , Calculate hash-value , if the two has same hash > vale

[algogeeks] finding anagrams in file

2011-10-18 Thread Arun Vishwanathan
Hi all, How to find all the anagrams in a large file containing n words and max length of a word is m letters?? so if file contains add dad abc ced cba it shud say adc dad are anagrams and abc cba are anagrams. time needed is 0(nlogn) -- "People often say that motivation doesn't last. Wel

[algogeeks] another group?

2011-10-06 Thread Arun Vishwanathan
questions he can either post them to the same group itself or otherwsie to the algos group if a general algo is needed or so from the paper...what say? Arun -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, sen

[algogeeks] MS-IT

2011-09-21 Thread ankit arun
hi!! MS-IT is visiting our college. could anyone plz help me in knowing what kind of questions(interview) they asked/asking. Thanks in advance. Ankit Arun NIT Durgapur -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To

[algogeeks] Re: K-LCS

2011-09-18 Thread Arun
Suffix Tree On Sep 18, 4:17 pm, pooja wrote: > Can some one please help me with this.. > the problem is to find  the longest substring in a list of around 100 > strings..?? > any idea.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To pos

Re: [algogeeks] Re: complement

2011-09-18 Thread Arun Vishwanathan
Thanks Dave , appreciate it On Sun, Sep 18, 2011 at 7:15 PM, Dave wrote: > @Arun: This is the way two's complement arithmetic works. For any x, - > x = ~x + 1. This says that to negate a number, complement it and add > 1. > > Technically speaking, two's complement is a

[algogeeks] complement

2011-09-18 Thread Arun Vishwanathan
Hi all, When I take negation of an integer in C, 0 is displayed as -1 ~5 is displayed as -6. Can some one tell me the logic of how this conversion is happening in C? Arun -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To po

Re: [algogeeks] Linkedlist problem

2011-09-06 Thread Arun prasath
if(nodeptr) { } On Mon, Sep 5, 2011 at 5:29 PM, $hr! k@nth wrote: > Hi guyz, > > *Given only a pointer to a node to be deleted in a singly linked list, how > do you delete it?* > > if that node is in between the list, we can copy the data from next node > into this node and we can delete the

[algogeeks] Re: SEEK advice very urgent

2011-09-01 Thread ankit arun
@ raj which clg r u from? I would say btr to choose its branch in Singapore. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/eUlkIYwpzTgJ. To post to this

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread ankit arun
Ya sure... :) After posting it Igot even more confused... On Sat, Aug 27, 2011 at 9:33 AM, siddharth srivastava wrote: > > > On 27 August 2011 08:48, ankit arun wrote: > >> thanks everybody for so many suggestions... :) > > > > so let us know when you finish al

  1   2   3   >