an useful link
http://stackoverflow.com/questions/7338070/finding-an-element-in-an-array-where-every-element-is-repeated-odd-number-of-tim
On Fri, Apr 19, 2013 at 11:30 PM, kartik n kartik.car...@gmail.com wrote:
Hi Nishant i did not understand the code can u please describe a bit
Thanks
In an array, some numbers occur only once, some numbers occur twice, only
one number occur thrice. Find the number occuring thrice ? Space complexity
O(1) Time Complexity O(n). We should not use Hash Maps.
Please someone help..
--
You received this message because you are subscribed to the
We need to construct BST not binary tree.
On Sun, Mar 3, 2013 at 6:19 PM, Krishnan aariyankrish...@gmail.com wrote:
Example: when we have nodes 1,2,3. The Minimum weight is given by, 2-root
1-left 3-right (Min. Weight - 10) or 3-root 2-left 1-left(left of 2)
(Min. Weight -10).
On Sun
Given a set of numbers, we have to construct a tree such that their WEIGHT
is MINIMUM. WEIGHT(node value * height of the node).
(Root is at the height 1).
we need to print the minimum weight.
How to approach this problem ?
Pls somebody help
--
You received this message because you are
Example: when we have nodes 1,2,3. The Minimum weight is given by, 2-root
1-left 3-right (Min. Weight - 10) or 3-root 2-left 1-left(left of 2)
(Min. Weight -10).
On Sun, Mar 3, 2013 at 5:46 PM, Krishnan aariyankrish...@gmail.com wrote:
Given a set of numbers, we have to construct a tree
Kurkshetra'13 with GROUPON an International Techno-Management Fest Under
the patronage of UNESCO is conducting a Math Coding Contest * **ATHENA.* on
18-Jan-13 9:00 IST (3:30 GMT) .
Please participate if anybody is interested. It will be fun
http://kurukshetra.org.in/#!/events/athena
--
Try like merge sort.
http://www.geeksforgeeks.org/archives/3968
--
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
@mayank:
For each testcase sum is not zero make sum=0 inside the for loop
--
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
@ashish pant
We must compute all the queries in O(n)+O(k).
We must have array like counting array.
It is not my logic but my friend told about this logic
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Contest started.
http://www.spoj.pl/KOPC12/problems/main/sort=0,start=0
Top Indians can get internship at SAPLABS india.
--
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
Hi Coderz,
We would like to invite you all to participate in Kurukshetra OPC 2012
http://www.spoj.pl/KOPC12(An Individual Contest ), a 4-hour acm-icpc
style online programming competition, which is organized as a part
ofKurukshetrahttp://www.kurukshetra.org.in2012 , the Technical fest
of College
be list of sentences ranked in such a way that sentence
with FIRST rank is the most similar sentence in all 5 documents, then 2nd
then 3rd...
Thanks in advance.
Regards,
Anantha Krishnan
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
http://www.eazyupload.net/ukhyxosa
On Wed, Aug 31, 2011 at 7:29 PM, Swathi chukka.swa...@gmail.com wrote:
--
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
Regards,
Anantha Krishnan
On Wed, Aug 24, 2011 at 11:10 AM, Dheeraj Sharma
dheerajsharma1...@gmail.com wrote:
let the nodes are stored in array like
arr[1]
arr[2]
arr[3]
.
.
.
arr[7].
where arr is a structure having int x,int y.
i=1
initally we set the root(i.e arr[i]) x and y = n/2,log
int getDistance(Tnode *root,Tnode *node,int dist)
{
if(root==NULL)
return 0;
if(root==node)
return dist;
return
getDistance(root-left,node,dist+1)|getDistance(root-right,node,dist+1);
}
Thanks Regards,
Anantha Krishnan
On Thu, Aug 25, 2011 at 2:30 AM, rohit raman.u
Hi Sarvesh,
For this problem this is my solution.
A=[1,5,6]
n=len(A)
Ans=[0,1,1,2,1,2,2,3]
count=0
for i in range(0,n):
count=count+Ans[A[i]]
print count
Is there any flaw?
Thanks Regards,
Anantha Krishnan
On Sun, Aug 21, 2011 at 4:25 PM, sarvesh saran
aquarian.thun...@gmail.comwrote
minimum element.
7.repeat these steps till end of array is reached for atleast one array.
Please let me know if you find some difficulties with my explanation.
Thanks Regards,
Anantha Krishnan
On Thu, Aug 18, 2011 at 10:42 AM, MAC macatad...@gmail.com wrote:
any suggestion on how to approach
If we move the maximum then difference will get larger but our aim is to
minimize the difference.
Thanks Regards,
Anantha Krishnan
On Thu, Aug 18, 2011 at 1:01 PM, MAC macatad...@gmail.com wrote:
as per my understanding , you are increasing the minimum value so that it
reaches closer
Yes with my approach answer will be 0.
Please check here http://ideone.com/Q4ivj.
Thanks Regards,
Anantha Krishnan
On Thu, Aug 18, 2011 at 1:33 PM, MAC macatad...@gmail.com wrote:
in the example below , answer shd be 0 , . by your apraoch this is not
commig
10,25,35
10,25,30
5
We can use hash to do all the operations in O(1) time.
Thanks Regards,
Anantha Krishnan
On Thu, Aug 18, 2011 at 5:30 PM, Ankur Garg ankurga...@gmail.com wrote:
Define a data structure , using extra memory/space , such that :
Insert(int a)
Delete(int a)
isPresent(int a)
get(int a)
All
Refer here http://ideone.com/X77wm.
On Thu, Aug 18, 2011 at 5:36 PM, Ankur Garg ankurga...@gmail.com wrote:
Can u provide a bit detail bro !!
On Thu, Aug 18, 2011 at 8:04 AM, sagar pareek sagarpar...@gmail.comwrote:
Hashing
:)
On Thu, Aug 18, 2011 at 5:30 PM, Ankur Garg
We must use
BIThttp://www.topcoder.com/tc?module=Staticd1=tutorialsd2=binaryIndexedTreesto
solve this problem with O(nlogn).
Here http://ideone.com/IaU3F is my implementation.
Thanks Regards
Anantha Krishnan
On Tue, Jul 26, 2011 at 7:18 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
You
Excuse me MR.balaji :P
U got selected for Microsoft Redmond :P still preparing ? :P
On Thu, Jul 28, 2011 at 6:01 AM, Balaji S balaji.ceg...@gmail.com wrote:
Given a 3X3 matrix , with 1's 0's and -1's ( 1 is player one 0 is player two
-1 is none)
how ll you find who is the winner / draw in a
Anyone have an idea about DirectI Written test ?
Thanks in Advance !
Radhakrishnan,
CEG,AU,
Chennai
--
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
)
{
_printTree(root+File.separator+file, depth+1);
}
return;
}
return;
}
public static void printTree(String root)
{
_printTree(root, 0);
}*
Thanks Regards
Anantha Krishnan
On Wed, Jul 27, 2011 at 1:21 PM, geek
same question in MS written :P
On Sat, Jul 23, 2011 at 5:49 AM, Manish Kumar manish.monu...@gmail.com wrote:
@Akshata:
Whenever you increase any variable then it increases according to its type.
Here the address of array 'a' is being increased.( a+1 ).
so the address of 'a' will temporarily
Ok ! ppl started asking about books and send it to me :P
stop this thread :P
On Sat, Jul 23, 2011 at 8:56 AM, Arshad Alam alam3...@gmail.com wrote:
@Prabhu.. I don't have Let Us C solution..if you have soft copy.. can you
please send..
On Sat, Jul 23, 2011 at 9:12 PM, prabhu J
@SkRiPt KiDdIe
I got your logic.
Nice.
Thanks.
Regards
Anantha Krishnan
On Wed, Jul 20, 2011 at 2:04 PM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote:
While you are on a state do not change ur state on encountering a specific
character if u have already done so earlier.This check in addition
Can somebody please help me to print all non-redundant permutations of the
string. For ex. If string is abab the permutations are {baab, abba, abab,
baba, bbaa, aabb}
Thanks Regards
Anantha Krishnan
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
i think we should not use the answer from otherr ppl for these type of
questions ! This is design ! we have to think of ur own :P
--
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.
Really MS asking garbage collection questions ? :P
2) if the DLL is not sorted then it takes O(n lgn ) to build the BST
but the code looks so bloated if we write the code
On Mon, Jul 18, 2011 at 4:59 AM, Balaji S balaji.ceg...@gmail.com wrote:
Convert a binary tree to binary search tree
just hash it
On Fri, Jul 15, 2011 at 6:28 PM, Anand Shastri
anand.shastr...@gmail.com wrote:
Given a file containing 4,300,000,000 integers, how
can you find one that appears at least twice
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
if number is (131) -1 u declare a 2GB array ?
On Fri, Jul 15, 2011 at 6:59 PM, Anand Shastri
anand.shastr...@gmail.com wrote:
file any way contains integers why do we need hash those integers? why not
use the same integers to index an array.
On Fri, Jul 15, 2011 at 6:36 PM, radha krishnan
, Anand Shastri
anand.shastr...@gmail.com wrote:
File has 4,300,000,000 integers if you hash it will create a distinct hash
for 4,300,000,000 integers.
On Fri, Jul 15, 2011 at 7:09 PM, radha krishnan
radhakrishnance...@gmail.com wrote:
if number is (131) -1 u declare a 2GB array ?
On Fri, Jul
successfully ignored :P
On Thu, Jul 14, 2011 at 6:57 AM, Navneet Gupta navneetn...@gmail.com wrote:
Sending a test mail after re-joining the group. Please ignore.
--
Regards,
Navneet
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
For,
[ n*n!+(n+1)*(n+1)!+.+(n+m)*(n+m)! ] / (n+m+1)! = 1 - n!/(n+m+1)!
On Sun, Jul 10, 2011 at 1:00 PM, Puneet Ginoria punnu.gino...@gmail.comwrote:
n*n! = (n+1)! - n!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
#includestdio.h
void main(){
signed x;
unsigned y;
x = 10 +- 10u + 10u +- 10;
y = x;
if(x==y)
printf(%d %d,x,y);
else if(x!=y)
printf(%u %u,x,y);
}
OUTPUT?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
(1*1!+2*2!+3*3!+4*4!+10*10!)/11!
.
is there any shortcut methods to solve such problems?
find the odd one out...
13700, 1597, 326, 65, 16 , 6 , 2
and i have no clue to how to solve the second question
--
You received this message because you are subscribed to the Google
hey guys, do you know any website that offers really good aptitude
questions...like interview aptitude questions!!!
i think those are really tough than anything that we find in books
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
,
if it is negative, find the min value, assume it is X, add by (-X)+1))
Now assume numbers are M, compute the product of the numbers and compute
M!
and check if they are equal.
does it work ?
Thanks,
Sathaiah
On Wed, Jul 6, 2011 at 11:45 AM, Anantha Krishnan
I guess it can be done in O(mlog m) TC with* heap sort*
On Fri, Jul 8, 2011 at 1:56 AM, Dumanshu duman...@gmail.com wrote:
given two sorted arrays a[m] b[2*m], each contains m elements only.
You
need to merge those two arrays into second array b[2*m].
anything better than O(m^2)
--
can anybody suggest some good array or matrix related problems!
--
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
it :P
On Fri, Jul 8, 2011 at 9:40 PM, Sriganesh Krishnan 2448...@gmail.comwrote:
can anybody suggest some good array or matrix related problems!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
:Given two sorted arrays a[]={1,3,77,78,90} and b[]={2,5,79,81}. Merge
these two arrays, no extra spaces are allowed. Output has to be
a[]={1,2,3,5,77} and b[]={78,79,81,90}.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
--;
}
for(k=0;ksizeof(a)/sizeof(a[0]);k++)
printf(%d ,a[k]);
puts(\n);
for(k=0;ksizeof(b)/sizeof(b[0]);k++)
printf(%d ,b[k]);
puts(\n);
system(pause);
}
On 7/8/11, radha krishnan radhakrishnance...@gmail.com wrote:
:Given two sorted arrays
Check this
*int isconsecutive(int a[], int n) {*
*if (n 1) {*
*return 0;*
*}*
*int max = a[0], min = a[0];*
*int i = 0;*
*
*
*int *hash = (int*) calloc(n, sizeof (int));*
*
*
*//find min and max from the array*
*for (i = 1; i n; i++) {*
*if (a[i]
i think this puzzle follows arithmetic progression...i'm not sure
though...does anybody have a clean explanation for this?
On Wed, Jul 6, 2011 at 10:35 PM, shiv narayan narayan.shiv...@gmail.comwrote:
* You are given 2 eggs.
* You have access to a 100-storey building.
* Eggs can be very hard
@tiru and @aseem: explanation pls...!
On Wed, Jul 6, 2011 at 11:11 PM, TIRU REDDY tiru...@gmail.com wrote:
14
On 6 Jul 2011 22:35, shiv narayan narayan.shiv...@gmail.com wrote:
* You are given 2 eggs.
* You have access to a 100-storey building.
* Eggs can be very hard or very fragile
nothing :P BFS :P
On Wed, Jul 6, 2011 at 1:23 PM, KK kunalkapadi...@gmail.com wrote:
https://www.spoj.pl/problems/SHOP/
Anybody plzz post a solution to the above problem...
i tried with dp but it failed...
How to implement with DFS or if possible with DP???
--
You received this message
This is a gud question thougth the answer is not bipartitie matching
If the graph has a cycle then answer is impossible
The next question is whether the graph is connected ?
say 1)when the graph is connected then it should be a tree to get
split into two groups easily by assigning some colors /
never mind am wrong ! :P :P
On Tue, Jul 5, 2011 at 12:07 PM, radha krishnan
radhakrishnance...@gmail.com wrote:
This is a gud question thougth the answer is not bipartitie matching
If the graph has a cycle then answer is impossible
The next question is whether the graph is connected ?
say 1
lengths.
Thanks Regards
Anantha Krishnan
--
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
Hi All,
I want to know which data structure will be efficient for a desktop search
tool similar to Ava Find http://www2.think-less-do-more.com/avafind/.
Thanks Regards
Anantha Krishnan
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
http://ideone.com/qYKMW.
Thanks Regards
Anantha Krishnan
On Tue, Jul 5, 2011 at 7:52 AM, Ashish Goel ashg...@gmail.com wrote:
convert BST into DLL
refer stanford tree recursion problem
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Mon
y=*x++;
this line executes like this:
y=*x;
x=x+1; // post increment
Regards
Anantha Krishnan
On Mon, Jul 4, 2011 at 10:36 AM, amit kumar amitthecoo...@gmail.com wrote:
i think d answer sud be 10.
but it comes out to be 5.
xplain plz
On Mon, Jul 4, 2011 at 10:30 AM, Sandeep Jain sandeep6
Given a string containing 0's and 1's. One would need to find the longest
sub-string such that the count of 0's is equal to the count of 1's in the
largest sub string.
Regards
Anantha Krishnan
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group
Thanks.
Can you plz explain for input 1 0 1 1 0 1 1 1.
Also I want solution in O(n) TC and O(1) SC.
Regards
Anantha Krishnan
On Fri, Jul 1, 2011 at 4:13 PM, sunny agrawal sunny816.i...@gmail.comwrote:
Take an array of size of the length of the string.
fill the array positions with one where
, Jul 1, 2011 at 4:21 PM, Anantha Krishnan
ananthakrishnan@gmail.com wrote:
Thanks.
Can you plz explain for input 1 0 1 1 0 1 1 1.
Also I want solution in O(n) TC and O(1) SC.
Regards
Anantha Krishnan
On Fri, Jul 1, 2011 at 4:13 PM, sunny agrawal sunny816.i...@gmail.comwrote:
Take
@Sunny
Thanks for your algorithm :)
It works well.
http://ideone.com/MHOtR
Thanks Regards
Anantha Krishnan
On Fri, Jul 1, 2011 at 4:38 PM, sunny agrawal sunny816.i...@gmail.comwrote:
String = 1 0 1 1 0 1 1 1.
1. make the array = 1 -1 1 1 -1 1 1 1
2. after second operation
array = 1 0 1
-data;*
*} while (root-right == node || root-right == NULL);*
*if (root-right != NULL)*
*root = root-right;*
*}*
*}*
*return NULL;*
*}*
Thanks Regards
Anantha Krishnan
On Thu, Jun 30, 2011 at 2:12 PM, vikas mehta...@gmail.com wrote:
for 1 i
Check this
http://ideone.com/1I40z
On Wed, Jun 29, 2011 at 8:04 PM, Nishant Mittal
mittal.nishan...@gmail.comwrote:
segregate even and odd nodes in a singly linked list.Order of even and
odd numbers must be same...
e.g:-
i/p list is 4-1-3-6-12-8-7-NULL
o/p list 4-6-12-8-1-3-7-NULL
--
@sagar pareek
If there are more fields in the node like:
struct node{
int data;
float mark;
char ch;
struct node *link;
};
Here swapping *data* alone will corrupt the list right!!
On Thu, Jun 30, 2011 at 4:38 PM, sagar pareek sagarpar...@gmail.com wrote:
Here is one
Check this http://ideone.com/ARsJ1
On Thu, Jun 30, 2011 at 7:48 PM, oppilas . jatka.oppimi...@gmail.comwrote:
I am unable to find a test case where this particular approach fails( I
hardly thinks it's correct but anyway here it is).
We make the last element the root of the BST.
And keep
,leftb,midb-1);
elseif(a[mida]bmidb])
kthlargest(a[],b[],lefta,mida-1,midb+1,rightb,);
else
return a[mida];
}
On 6/25/11, Anantha Krishnan ananthakrishnan@gmail.com wrote:
Idea is like this since both the arrays may not be of same length lets
divide (k-1) smallest elements
How we will get phone number of a particular person?
Thanks Regards,
Anantha Krishnan
On Wed, Jun 29, 2011 at 6:22 PM, sudheer kumar
chigullapallysudh...@gmail.com wrote:
USE TRIE
On Wed, Jun 29, 2011 at 6:10 PM, shady sinv...@gmail.com wrote:
go through the archives you will definitely
Check this
http://ideone.com/o8gF2
On Wed, Jun 29, 2011 at 10:28 PM, Swathi chukka.swa...@gmail.com wrote:
This should be very simple... follow inorder..
Inorder(Node* node, int counter, int N)
{
if(node == null)return;
Inorder(node-left, counter, N);
counter++;
if(counter == N)
{
I wish to say that we should not use any inbuilt functions.
On Wed, Jun 29, 2011 at 11:43 PM, oppilas . jatka.oppimi...@gmail.comwrote:
What I wanted to say that, it's a trivial question for algorithmic point of
view.
You could have just implemented a normal function without worrying about
http://ideone.com/oEfLE
On Thu, Jun 30, 2011 at 12:04 AM, Anantha Krishnan
ananthakrishnan@gmail.com wrote:
I wish to say that we should not use any inbuilt functions.
On Wed, Jun 29, 2011 at 11:43 PM, oppilas . jatka.oppimi...@gmail.comwrote:
What I wanted to say that, it's a trivial
You asked the Most Efficient dude
On Mon, Jun 27, 2011 at 10:29 PM, vaibhav agarwal
vibhu.bitspil...@gmail.com wrote:
@radha: hw abt using a fixed size circular list?
On Sat, Jun 25, 2011 at 8:25 PM, radha krishnan
radhakrishnance...@gmail.com wrote:
simple!!
Stack:P
On Sat, Jun 25
+1 :P
On Tue, Jun 28, 2011 at 12:27 AM, hary rathor harry.rat...@gmail.com wrote:
very funny ! every one know this site swathi
--
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.
Yes ! Count Sort !!
On Sun, Jun 26, 2011 at 1:44 PM, ross jagadish1...@gmail.com wrote:
Given a sequence of numbers in the range of 1-N^2, what is the most
efficient way to sort the numbers (better than NlgN)..
Can counting sort be used here? Is an O(N) solution possible..
--
You received
(1024);*
Thanks Regards,
Anantha Krishnan
On Sat, Jun 25, 2011 at 2:16 PM, Adarsh s.adars...@gmail.com wrote:
char array[] = hello;
char *pointer = hello;
array is an array, enough to store sequence of characters and '\0'
array will always refer to same storage.
Here, pointer is initialized
Good.
On Sat, Jun 25, 2011 at 4:47 PM, RITESH SRIVASTAV
riteshkumar...@gmail.comwrote:
sizeof returns size_t values and size_t is typedef unsigned int
size_t;
but when you compare it with -1(int) ,d=-1 is converted to unsigned
int
which becomes very large (INT_MAX)
and d (INT_MAX) 7 so
simple!!
Stack:P
On Sat, Jun 25, 2011 at 8:11 PM, rShetty rajeevr...@gmail.com wrote:
Suggest the most efficient Data Structures and algorithms to implement
Undo and Redo operations in any of the Office Suites ?
--
You received this message because you are subscribed to the Google Groups
Include Euler !!!
On Fri, Jun 24, 2011 at 12:11 PM, Vishnutej Mylavarapu
mylavarapu.vishnu...@gmail.com wrote:
You can add AC Rush too..
On Fri, Jun 24, 2011 at 11:27 AM, rajeev bharshetty
rajeevr...@gmail.comwrote:
@ankit Thanks for the suggestion , I ahve Updated to include petr
Check this http://ideone.com/C8fQC
http://ideone.com/C8fQCThanks Regards,
Anantha Krishnan
On Fri, Jun 24, 2011 at 10:18 PM, Decipher ankurseth...@gmail.com wrote:
Can anybody please explain how to solve this question with logarithmic
time complexity ?
Write the code/algorithm to find
for understanding)
B[-1]=-INF A[0]=20 B[0]=10 [not in asc order]
A[-1]=-INF B[0]=10 A[0]=20 [in asc order]
We got the Kth(4th) smallest element which is 10.
Thanks Regards,
Anantha Krishnan
On Fri, Jun 24, 2011 at 11:20 PM, Akshata Sharma
akshatasharm...@gmail.comwrote:
@Anantha
can you explain
[]=abcdaabcdefe;
int buff[256]={0};
for(int i=0;istrlen(inp);i++)
buff[inp[i]]++;
for(int j=0;j256;j++)
while(buff[j]--) cout(char)j;
On Wed, Jun 22, 2011 at 10:27 AM, Sriganesh Krishnan
2448...@gmail.comwrote:
Input will be a string. We need to o/p a string
oh...an array of constant length signify's constant memorywhy dint i see
that...thanks guys!!!
regards
---sriji!!
On Thu, Jun 23, 2011 at 6:35 PM, Sriganesh Krishnan 2448...@gmail.comwrote:
ya i needed the same thing!
On Wed, Jun 22, 2011 at 3:04 PM, saurabh singh saurab
Hi All,
Can someone explain about the time complexity of Merge sort(Linked list with
billions of node)?
There is no way to find the middle of sub-list without traversing
completely.
Please clear my doubts.
Thanks Regards,
Anantha Krishnan
--
You received this message because you
can you explain mewhat the logic is...behind the xor operation?...is it
like inversion or encryption?
On Thu, Jun 23, 2011 at 11:59 AM, sunny agrawal sunny816.i...@gmail.comwrote:
initially compute xor of all the values from 0 to n in a variable Temp
so temp = 0^1^2^n
let result
Krishnan
On Fri, Jun 24, 2011 at 12:58 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
Also u can refer
http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
On 6/24/11, Piyush Sinha ecstasy.piy...@gmail.com wrote:
I googled a better explaination for this and found
I modified Sunny's code to get Node X and Node Y.
http://ideone.com/YF9qi
Can we do better than this?
Thanks Regards,
Anantha Krishnan
On Wed, Jun 22, 2011 at 11:11 AM, oppilas . jatka.oppimi...@gmail.comwrote:
Sunny,
Can but can we modify this code to get the *node X and node Y
@balaji : i think u understand the question in wrong way !!
The solution is to use Manchar Algorithm !! But thats hard to implement
On Wed, Jun 22, 2011 at 12:05 AM, Balaji S balaji.ceg...@gmail.com wrote:
LCS(string,reverse(string)) ?? but this is not O(n) ryt..
--
With Regards,
Hi All,
I have written code for finding diameter of a binary tree here
http://ideone.com/WHg9t
Is it correct? Do I need to make any changes there?
Thanks Regards
Anantha Krishnan
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
= new Node(8, NULL, g);*
*Node* a = new Node(1, b, c);*
*Root = a;*
*}*
*
*
and check here http://ideone.com/YF9qi.
Let me know the result.
Thanks Regards
Anantha Krishnan
On Thu, Jun 23, 2011 at 2:06 AM, Jitendra singh jsinghrath...@gmail.comwrote:
I think this solution
Regards
Anantha Krishnan
--
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
Thanks.
I expect more details in implementation point of view.
Thanks Regards,
Anantha Krishnan
On Tue, Jun 21, 2011 at 6:41 PM, sunny agrawal sunny816.i...@gmail.comwrote:
@Piyush
good to start with
But i think a recursive O(n) is possible
in downward calls pass sum from root to node
@sunny agrawal
*Thanks a lot.*
*Great code. I got the logic now.Thanks again.*
*
*
Thanks Regards,
Anantha Krishnan
On Tue, Jun 21, 2011 at 11:52 PM, sunny agrawal sunny816.i...@gmail.comwrote:
see this
*
https://ideone.com/1ZtIq*
On Tue, Jun 21, 2011 at 10:23 PM, Anantha Krishnan
nice!!
On Tue, Jun 21, 2011 at 10:47 PM, Nitish Garg nitishgarg1...@gmail.comwrote:
The answer is 1 only as stated in the above posts.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
ya...we can do it in O(n) n time!!!
nice question!
On Tue, Jun 21, 2011 at 11:01 PM, himanshu kansal
himanshukansal...@gmail.com wrote:
@anika: yar merge sort vl tk nlogn timeinstead u cn do dt maintain two
ptrs one at the beginning and one intitially pointing to middle of the
array...
Input will be a string. We need to o/p a string with the order of characters
same as the input but with same characters grouped together.
I/P: abcdacde
O/P: aabccdde
I/P: kapilrajadurga
O/P: kpilrrjdug
I/P: 1232
O/P: 1223 …….. O(n) time……….. O(1) space….
how can you approach these
Another use of XOR is to generate some random numbers
And XOR is extensively used in the field of CryptoGraphy !!!
--
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
Ma approach is to xor the given number with all numbers in the file !!
This takes O(n)
I think we cant achieve a complexity O(n)
we have to scan the file at least once
Or move to this problem
Instead of a file with numbers
you have a stream of numbers
Create a Trie and insert every number from
));
}
Thanks Regards,
Anantha Krishnan
On Thu, Jun 9, 2011 at 4:54 PM, Navneet Gupta navneetn...@gmail.com wrote:
Ohh. Missed out the nlogn condition you mentioned. It will do but in n^2
Sent from my Windows Phone
--
From: D.N.Vishwakarma@IITR
Sent: Thursday, 9 June
@balaji :)
This is a question
But don tell this is a MS quesiton :P :P :P
On Thu, Jun 2, 2011 at 11:40 PM, Balaji S balaji.ceg...@gmail.com wrote:
how s that output obtained??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
Can u please leave this Group
? ?? ?
On Sat, May 28, 2011 at 1:12 PM, sunny sunny31031...@gmail.com wrote:
hi all of you you all can earn 2000+ money from internet by just
spending sometime.i have done this and it's awesome really .
.so i am sharing the link .so
sort :)
On Fri, May 27, 2011 at 6:57 PM, ross jagadish1...@gmail.com wrote:
Hi all,
Given an array of elements find the largest possible number that can
be formed by using the elements of the array.
eg: 10 9
ans: 910
2 3 5 78
ans: 78532
100 9
ans: 9100
--
You received this
Haha !! Any counter case against sort ? ?? ? :P
On Fri, May 27, 2011 at 7:02 PM, adityasir...@gmail.com wrote:
are you kidding me. Just simple sort wont work.
On Fri, May 27, 2011 at 9:31 AM, radha krishnan
radhakrishnance...@gmail.com wrote:
sort :)
On Fri, May 27, 2011 at 6:57 PM
+100
On Thu, May 26, 2011 at 9:26 PM, pacific :-) pacific4...@gmail.com wrote:
+1
On Wed, May 25, 2011 at 11:48 PM, anuj agarwal coolbuddy...@gmail.comwrote:
Hi,
Are there any admins on this group? I recently joined this group and i
liked the discussions going on here.
But there is a
1 - 100 of 137 matches
Mail list logo