Hey group,
This is kind of a cliched question but given a file with billion numbers
and the task is to compute 'k' largest numbers from this file, what
approach is preferred?
1) Using heaps
2) Using Median-of-median algorithm.
Have read few links which prefer heaps but clearly median of median
al
The in-order and pre-order traversal are already given. So, there is no way
to do what you are saying if I understand you completely.
On Sun, Nov 27, 2011 at 8:19 AM, Ankuj Gupta wrote:
> Hint : try with prestoring the preorder traversal element position in
> inorder traversal before constructin
*Assumptions*:
- All positive elements in the array
- All elements in array are in range 0 to (n-1) [ n - # of elements]
1) Scan the array. For every element A[i], negate the value stored in
A[A[i]].
2) If you encounter an element already negated, then that represents the
duplicate element.
On T
Can anyone please explain the logic instead of the actual code?
Sent from iPhone.
On Aug 31, 2011, at 4:16 AM, aditya kumar wrote:
>
> @rohit : else return (check(tree->left) || check(tree->right)); should be
> else return (check(tree->left) && check(tree->right));
> we need both
Sukran,
There's a thread I started recently which asks about binary tree
isomorphism. But to sum it all up here, isomorphism refers to "same
structure". Though "isomorphism" is used pretty flexibly w.r.t to binary
trees, here's what I have read from different sources.
- 2 binary trees are isomorp
Would this work:
boolean IsQuasiIsomorphic(Node x, Node y)
{
if (x == null && y == null) return true // both null
if (x == null || y == null) return false // exactly one null
//Else, the left sub-tree of tree 1 is isomorphic to the left or right
subtree of tree 2
return ( ( IsQ
Since both the "normal" recursive (stack overflow) and non-recursive (data
type overflow) versions fails, is there a way one can use linked lists to
solve this problem?
Bharath.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to thi
The subject has the problem description. What are some efficient ways of
doing this. As always, the approach description is more useful than the
actual code itself.
Thanks!
Bharath.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to
Can anyone give the recursive version of reversing a linked list. Please
post the reverse function code snippet and not the entire .c file since it
just hampers readability.
Bharath.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to
Use Max - heap of size K.
On Wed, Mar 16, 2011 at 10:36 AM, DIPANKAR DUTTA wrote:
> use heap tree to slove this..
> plz see careercup post..
>
>
> On Wed, Mar 16, 2011 at 10:31 AM, Ankit Sinha wrote:
>
>> Asked in Amazon interview..
>>
>> Find the first K smallest element from 1 million sized a
I need to pass an array of values from html(preferably Javascript) to
servlets...
Plz give me the coding I need to use...
--
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 unsu
LinkedIn
Sriram Narasimhan requested to add you as a connection on LinkedIn:
--
Phani,
I'd like to add you to my professional network on LinkedIn.
- Sriram
Accept invitation from Sriram Narasimhan
http://www.linkedin.
*Microsoft Student Partners, Chennai & CNUGStudent.Net*
*Present*
*ACADEMIC DEVELOPER CONFERENCE*
*ADC 2008*
*http://cnugstudent.net
www.student-partners.com*
* *
* *
Hi All,
Microsoft Student Partners of Chennai and the CNUG Student
Chapter are proud to present the Academic
Hi gupta,
you can use Data structures and algorithms by mark allan weiss for learning DATA structures...
All the best.
Sriram.N
On 7/24/06, gupta <[EMAIL PROTECTED]> wrote:
hai frnz...this is gupta, student of iitm doing masters in non csc background. iam very new for this group.
Hi
there are plenty of websites that fetch you data and i feel that everything is just a click away.So just choose books if you want else just start learning via tutorials.
All the best.
Sriram.N
On 7/9/06, hosseingt <[EMAIL PROTECTED]> wrote:
hii'm a begginer.can anyone guide me how to s
Hi
The best algorithm which you can use which has minimal space and time complexity is RADIX SORT...But one doubt do you really specify that every column has one element in it?
Anyway you can process your array using RADIX SORT..
Sriram.N
On 6/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wr
Dear sir,
I m Sriram doing my first year ENGG at Hindustan college of Engg,chennai,India. Actually im interested in attending the WORLDCOMP'06 but due to the semester examinations i would not be attending the programme.Thanks
a lot for your invitation.I look forward to atten
hi everyone,
1.Can topological sorting be stated as an application of depth first search(DFS)...
2.What is inorder predecessor?how wil i find it???
pls reply
Sriram
--~--~-~--~~~---~--~~
You received this message because
hi ankur,
Thanks for sending me the link but the greedy algorthms are not opening...wat should i do now...
Sriram
On 6/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
hey sriram i got this animated greedy for u .may be u can try it out ...the link:
http://oopw
hi guys,
can anyone mail me the sorting algorithms and other greedy algorithms in animated format...i want it vey badly so as to study for the univ examination...pls mail me...
Sriram.N
--~--~-~--~~~---~--~~
You received this message because you are sub
Hi arunachalam
The program you have suggested is not working...can you tel me any other way...
Sriram
On 5/27/06, Arunachalam <[EMAIL PROTECTED]> wrote:
How about this program?
#include
#define FULL ma##in
int FULL (){ printf("hello world"); r
Sort the elements initially and then you can logically solve it..i don kno the logic..but do mail me if you get a logic.pls help me i m beginnin to learn computers...
Sriram.N
On 5/19/06, Terry <[EMAIL PROTECTED]> wrote:
Hi,If i have an array like {1,4, 10, 15 , 20 , 30 } of size n , now if iwa
hi guys,
i wrote a program for arrays and i declared only a[3]. but my array accepts a[5]=10; statements and other statements...how is that possible..arrays are considered as continuous memory of same datatype isnt it...but the array a[3] becomes discontinuous...
wat could be the pos
/06, A S Grewal <[EMAIL PROTECTED]> wrote:
Hi Sriram,Pop by definition must clear the last inserted value from the memory.So yes, you should be able to overwrite in that space.
Ajeet
--~--~-~--~~~---~--~~
You received this message because you are subscribed
hi guys,
When we use the pop function in stacks are the values deleted from the memory or not...that means we must be able to ovewrite in that spaces right...Can anyone clear my doubt...
Sriram
--~--~-~--~~~---~--~~
You received this message because
hi arul,
i think you can write a program in c without main().The main fn is used to start the program so if you could direct the compiler how to proceed about then you can definitely write the program.
sriram
On 5/14/06, Arulanandan P <[EMAIL PROTECTED]> wrote:
hi , Can a
queues are inmplimented on the firstcome first served
The principle for queues is FIFO ie first in first out...
mail me u r comments..
Sriram
On 5/7/06, akshay ranjan <[EMAIL PROTECTED]> wrote:
Are the queues being implemented on first come first serve basis or is thre some priorit
sorry adak...but i want all you guys to help me out in learning computers...sorry pls reply me...
Sriram
On 5/7/06, adak <[EMAIL PROTECTED]> wrote:
Welcome to you both. Sriram, it's VERY discourteous to post anunrelated reply to Anish's post, just above.
Either don't do
Hi anish
i m sriram...i m also new to this group doing my firstyear engineering.i m interested in learning more on computerspls help me to learn more and pls teach me the logics and other stuffs which are necessary for me...introduce me to your friends also...
thankyou
Sriram.N
i dont think it is specific for array implimentation of stacks.
Sriram.
On 5/6/06, akshay ranjan <[EMAIL PROTECTED]> wrote:
isn't this specific for array implementation of stack onlyits written in the original ques that no assumptions about the implementation are to be mad
hi geeks...
my query is
1. if the user presses 1,0 should be printed and if the user presses
0,1 should be printed.
2. no usage of conditional statements.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm
31 matches
Mail list logo