C itself
On Sat, Mar 17, 2012 at 8:39 PM, rahul sharma rahul23111...@gmail.comwrote:
in binary tree..
suppose c is parent of dnow if i want to find least common ancesor of
c and dwhther it is parent of c or c itself
--
You received this message because you are subscribed to the
.
using AVL or RB for the given algo may screw it.
On Mon, Mar 12, 2012 at 11:00 PM, sunny agrawal
sunny816.i...@gmail.comwrote:
@atul
TC can be bound to O(nlgn) using any balanced tree ie: AVL tree, RB tree
as already mentioned in her last post
On Mon, Mar 12, 2012 at 10:44 PM, atul anand
this is not the right place to ask such queries
On Sun, Feb 26, 2012 at 5:38 PM, vivek kumar kumarvivek1...@gmail.comwrote:
hey guys any one have idea about aricent online paper ..
plzzz tell me thankss
On Sat, Feb 25, 2012 at 8:25 PM, vivek kumar kumarvivek1...@gmail.comwrote:
can u
Given an array of N integers, Find two Numbers with max XOR value.
Naive Algorithm is O(N^2), what can be a better approach ?
--
Sunny Aggrawal
B.Tech. V year,CSI
Indian Institute Of Technology,Roorkee
--
You received this message because you are subscribed to the Google Groups
Algorithm
i dont know if a better solution exists
but here is one with complexity O(N*logS)...
N = no of elements in array
S = max sum of a subarray that is sum of all the elements as all are
positive
algo goes as follows
do a binary search in range 0-S, for each such candidate sum find how many
sums are
:16 AM, shady sinv...@gmail.com wrote:
didn't get you, how to check for subsequences which doesn't start from the
beginning ? can you explain for that same example... should we check for
all contiguous subsequences of some particular length?
On Tue, Feb 21, 2012 at 11:15 PM, sunny agrawal
...
On Wed, Feb 22, 2012 at 12:41 AM, sunny agrawal
sunny816.i...@gmail.comwrote:
we need to find how many sums are less than candidate Sum chosen in one
iteration of binary search in range 0-S
To count this, for each i we try to find how many sums ending at i are
lesser than candidate sum
?? will it not add
to the complexity
On Wed, Feb 22, 2012 at 9:59 AM, sunny agrawal sunny816.i...@gmail.comwrote:
@atul there are 8 sums less than 7
sum[0 - 0] = 1
sum[1-1] = 2
sum[2 - 2] = 3
sum[3-3] = 4
sum[4-4] = 5
sum[0-1] = 3
sum[0-2] = 6
sum[1-2] = 5
contiguous sum (1,2) , (2,3
are searching each
element in given input array from range 0-S
for given input = 1,2,3,4,5
S= 15
please clarify . sorry but i am not getting it ...
On Wed, Feb 22, 2012 at 10:25 AM, sunny agrawal
sunny816.i...@gmail.comwrote:
Yes, read my first post
On Wed, Feb 22, 2012 at 10
in Miller Rabin random value a is lesser than n...
i think u r missing it, isn't it ??
On Wed, Jan 18, 2012 at 3:28 PM, Sourabh Singh singhsourab...@gmail.comwrote:
@ALL hi everyone m trying to make prime checker based on miller-rabin
test . can some1 point out . wat's wrong with the code.
That is Okay but for checking a number n to be prime the chosen values of a
should be less than n according to algorithm
On Wed, Jan 18, 2012 at 3:45 PM, Sourabh Singh singhsourab...@gmail.comwrote:
@all output's to above code are just random.. some prime's. found
correctly while some are not
isn't the answer will be 1/3, without any calculations :)
On Thu, Jan 19, 2012 at 7:10 AM, Sundi sundi...@gmail.com wrote:
there are 52 cards.. there are 3 players a1,a2,a3 each player is given
2 cards each one of A=2...J=11,Q=12,K=13..a user wins if his sum of
cards is greater then the other
considering number to be a 32 number(also applicable in the same way to 64 bit)
one possibility is
let x be the number
find log10x
for 32 bit numbers max value of n is 64
so for n = 1 to 64
find p = logx10/n
take antilog and take nearest integer as m
m = 10^p;
again find m^n
if it is equal to x
this is not suddenly, this is happening from the last few months, you
might not have noticed.
this was done because of a lot of unrelated topics and interview queries.
one better thing that can be done is to allow some users for direct posting :)
On Tue, Dec 27, 2011 at 3:34 PM, Lucifer
oops...
wanted to write the same but yeah its meaning turns out to be totally
different :(
anyways very well explained by Lucifier
@shashank
i think now u will be able to get why there will be only 2k comparisons in
the worst case
On Thu, Dec 15, 2011 at 10:51 PM, atul anand
i am Considering given heap as min heap
Sol - because heap has property that root will has lower value than all
the elements in its left sub tree and right sub tree
so in main we will call a function passing root and value k and x
if at any time root is greater than x and k 0 that means rest of
@shashank
nope only 2k comparisions
k numbers which are greater than x and k which are less than x
dont think in terms of root and child
On Thu, Dec 15, 2011 at 12:57 PM, WgpShashank shashank7andr...@gmail.comwrote:
more clarification , why number of comparisons are 3k , because we are
looking
@aayush
Lots of member are here but that doesn't mean that you should start posting
the things which are strictly banned on this group. I hope you will take
care next time while posting anything in this group.
On Tue, Dec 13, 2011 at 7:40 PM, rahul sharma rahul23111...@gmail.comwrote:
On
http://groups.google.com/group/interview-street
On Tue, Dec 13, 2011 at 10:19 PM, tech coder techcoderonw...@gmail.comwrote:
which other group u people are talking about, i would like to join that
group.
On Tue, Dec 13, 2011 at 9:21 PM, sunny agrawal sunny816.i...@gmail.comwrote:
@aayush
http://www.gild.com/challenges/details/295
No of connected components, use BFS/DFS
On Sun, Dec 4, 2011 at 9:12 PM, rajesh ko ko.rajes...@gmail.com wrote:
We have given a black and white image and a fill tool that turn an
area of black pixel into white pixels. Fill tool works like a 8-way
Given a, n, P
find the value of a^(nth Fibonacci number) % P
where a and P are *not* Co-prime
--
Sunny Aggrawal
B.Tech. V year,CSI
Indian Institute Of Technology,Roorkee
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
i also doubt about the time and space complexity of the problem, i has been
asked a number of times with these constraints but never been answered the
required, as far as i remember the best solution to this problem that has
been discussed so far is using hashing and that too theoretically having
one solution is use BFS
On Mon, Nov 14, 2011 at 8:52 PM, Anshul AGARWAL
anshul.agarwa...@gmail.com wrote:
i m try to increase current floor c by push up button until it equal or
greater than g and increase co-responding push p.when my current
floor is greater than g.i push down button once
i/p o/p files are attached in the post, see carefully :-o
On Fri, Nov 4, 2011 at 6:23 PM, Dumanshu duman...@gmail.com wrote:
plz post a samle input output..
On Nov 4, 10:24 am, sunny agrawal sunny816.i...@gmail.com wrote:
What can be a better solution than a Brute Force O(N^2* No of iteration
No,O(N^2) because all the flips happens simultaneously, it can be
reduce to O(2N) if each tile is represented using a single bit
On Fri, Nov 4, 2011 at 11:12 PM, Dumanshu duman...@gmail.com wrote:
is ur brute force O(1) for space?
On Nov 4, 10:24 am, sunny agrawal sunny816.i...@gmail.com wrote
This is a challenge problem
and you don't need to find a best solution for each case, optimal
solutions are acceptable if they satisfy the problem constraints
for this problem the constraint is cuts should be made so that both
are able to eat equal no of each available ingredient
Examples:
Lets
at 7:25 PM, shady sinv...@gmail.com wrote:
actually i wanted to know what approach the problem setter is using, since
this problem is NP hard so optimal solution is not always possible.
On Wed, Nov 2, 2011 at 7:20 PM, sunny agrawal sunny816.i...@gmail.com
wrote:
This is a challenge problem
O(n) is possible using in-shuffle but doing it in-place was the problem
in case of in-shuffle we need to know which of the elements have been
shuffle so we need O(n) bits of extra space;
O(nlgn) is possible using a quick sort like divide and conquer
algorithm.i read it somewhere and will
to make sure all the
partitions are unique .
The partitions can hav some elements ( K) in common but not the
entire elements in a partition (Should be UNIQUE) .
On 10/30/11, sunny agrawal sunny816.i...@gmail.com wrote:
Is there any condition like all sets should have same
Is there any condition like all sets should have same no. Of elements
On 10/30/11, SAMMM somnath.nit...@gmail.com wrote:
But how does it ensure tht the elements been removed wouldnot give
the same set again
--
You received this message because you are subscribed to the Google Groups
hint 1: try to find 2 indexes i, j such that a[i] = K = a[j]
On Sun, Oct 23, 2011 at 11:23 PM, Ankuj Gupta ankuj2...@gmail.com wrote:
Given a sorted array of Infinite size, find an element ‘K’ in the
array without using extra memory in O (lgn) time
--
You received this message because you
yea i know 1st Approach is much better and is Only O(N^2) for
precomputing all the values for nck and then O(k) for finding no of
bits set in The Kth number and another loop of O(k) to find the
required number
i posted 2nd approach in the context to vandana's tree approach of
sorting 2^N numbers,
although input is small so a brute force will also do
but some optimization can be like
1. first we can find that how many bits will be set in Kth Codewords using
the following method
no of codewords with N bits set = 1
no of codewords with N-1 bits set = NC1
no of codewords with N-2 bits set =
No need of creating a tree
simply take an array of size 2^N in which all a[i] initialized to i
now sort the array first depending upon the set bits in the a[i] if set bits
are equal then use value
this function call to sort function of algorithms will do the required
bool cmp(int x, int y){
int
yes u r wrong
11
111 = 110 but sequence will be
11
101
110
On Thu, Oct 20, 2011 at 12:18 AM, tin a.gu...@tin.it wrote:
Can you just generate them sorted?
1 is the minimum
1 1 is the next in line
1 2 is the next one
1 N
11
11 1
and so on
Am i wrong?
Il 19/10/2011 19:33,
@sravan
yes you are given the sequence of elements in the order in which they are
traversed in the given traversal (in/pre/post)
a BST can be constructed from its post or pre order only but can not be
constructed from only inorder
in case of inorder we also need one more traversal
--
Sunny
if(you are a member already)
No need to post anything, just ignore the post :)
On Mon, Oct 17, 2011 at 5:38 PM, sravanreddy001 sravanreddy...@gmail.comwrote:
Wee are already members.. What is expected from us..
--
You received this message because you are subscribed to the Google Groups
This Question is from ACM-ICPC 2011 Amritapuri online round which ends today
at 1pm
so no answers to this post till 1 pm
On Sun, Oct 16, 2011 at 11:12 AM, Pradex pradam.prad...@gmail.com wrote:
Given two number A and B, count all the number lies between them
including both which have no more
CSI : Computer Science Integrated (5yr)
CSE is 4 year
On Sat, Oct 15, 2011 at 1:59 PM, hary rathor harry.rat...@gmail.com wrote:
sunny : are you in 5th year . i have heard that b-tech is 4 year degree?.
--
You received this message because you are subscribed to the Google Groups
Algorithm
i have already mentioned the source
it is famous shuffling algorithm. u can seach some papers on In-Shuffle
and Out-Shuffle
the original question in the shuffling is like how many times we need to
shuffle the cards after which they will return back to initial sequence.
On Sat, Oct 15, 2011
In/Out Shuffle are two shuffling algorithms used for shuffling cards
consider a pack of cards (so N = 52) and let cards are numbered from 1, 52
*In Shuffle *: cards are divided into 2 piles (k = 2)
(1,2,3.26) (27,28,...52)
afer one shuffle operation cards will be like
(27,1)(28,2)
Are you talking about 7th application th wiki of catalan numbers??
i think here case is differentregions are not necessarily triangles..
???
On Sun, Oct 16, 2011 at 3:43 AM, sravanreddy001 sravanreddy...@gmail.comwrote:
This is calalan Number. where n = k+1
very interesting and complex
Its Out Shuffle not In shuffle, although both are similar and you can read
both
On Fri, Oct 14, 2011 at 8:26 PM, sunny agrawal sunny816.i...@gmail.comwrote:
this problem is like Card shuffling problem(search for In-shuffle)
i think solution is
if indexing is zero based
each i will go
this problem is like Card shuffling problem(search for In-shuffle)
i think solution is
if indexing is zero based
each i will go to - k*i % (N-1)
k = 3 and N = 3*n -1
n = no of cards in one pile Or No of a's
On Fri, Oct 14, 2011 at 7:52 PM, shiva@Algo shiv.jays...@gmail.com wrote:
Given a n vertex polygon, find in how many ways k non intersecting diagonals
can be drawn ?
or
in How many ways it can be divided into k+1 regions such that no 2 diagonals
intersect ?
Limits:1 = k = N = 10^9
--
Sunny Aggrawal
B.Tech. V year,CSI
Indian Institute Of Technology,Roorkee
--
@Anshu
pushing adjacent element will cause duplicate entries in the heap
try the following example:
1 2 3 4 5 6 7
2 3 4 5 6 7 8
3 4 5 6 7 8 9
4 5 6 7 8 9 10
so we also need to maintain a data structure that can efficiently tell that
which cell has been pushed into the heap already.
On Thu, Oct
Nopes
Still it does not ensure that duplicates will not be there in the priority
queue
what i mean is you cannot write directly
do k times{
data = pop()
// let i,j are row and col of data
push(i+1,j);
push(i,j+1);
}
you need to add the following checks
if((i+1,j) is not in the heap)
i dont think k*k submatrix approach works at all
what if k =n size of submatrix will be n*n, which is matrix itself
heap seems to be a good approach with a coloring scheme that helps in
avoiding duplicates in heap ??
On Wed, Oct 12, 2011 at 7:18 PM, vikas vikas.rastogi2...@gmail.com wrote:
your solution seems to be the right one... testcases may be faulty
try submitting here http://www.codechef.com/problems/RESN04/ both the
codes
On Thu, Oct 13, 2011 at 5:44 AM, Hatta tmd...@gmail.com wrote:
being accepted doesn't imply in being correct
maybe I'm wrong but given this Test Case
1. how we can store the word each seperated by space into array if we are
considering binary tree???
Ans: Each Node will Have an array of Some Const Size limited by Max Word
length
2. how we can measure which is smaller than other according to
property??
Ans Obviously strcmp(str1,
Macros can Swap Pointers. and That is what the above code is doing.
On Mon, Oct 10, 2011 at 5:52 PM, rahul sharma rahul23111...@gmail.comwrote:
macros i thnik cant swap pointers..i have doubt for same it is test ur c
skil question
On Sun, Oct 9, 2011 at 10:08 PM, sunny agrawal sunny816.i
Counting Sort is really a Bad option for this Problem as range is not given
yes range can be find in single traversal but think if largest element is
10^9 and size of the array is just about 10^3
Counting Sort = O(10^9)
Simple Sorting = O(10^4)
Counting sort will perform bad in this case both in
Trie will take too much space..
Balanced Binary tree can be Better ...??
On Tue, Oct 11, 2011 at 12:16 AM, Ankur Garg ankurga...@gmail.com wrote:
I think this can be done through tries
Any better solution ?
On Mon, Oct 10, 2011 at 10:59 PM, sachin goyal monugoya...@gmail.comwrote:
remove
@Ankur
in Trie at each Node there will be 26 Pointers Stored, and Most of them
would be NULL, thats why i think it will waste space,
in Balanced Binary Tree i was thinking of storing the Complete Words at a
Node.
But now i think this is Better - Ternary Search
these are some lines form fflush man pages
For output streams, fflush() forces a write of all user-space buffered data
for the given output or update stream via the stream's underlying write
function. *For input streams, fflush() discards any buffered data that has
been fetched from the
because you have not made any call to swap values of x and y
I Don't know what you are trying to do here
if you want to swap values why are you not calling macro swap(x,y,int)
you are making a macro call to swap pointers and you can check that pointer
will get swapped.
On Sun, Oct 9, 2011 at
@Wasif
Yes Now this post is Irrelevant to Algogeeks.
@Others
Discuss about companies and interview Questions at new formed group Interview
Street http://groups.google.com/group/interview-street?hl=en
else you will be banned without any warnings
On Sat, Oct 8, 2011 at 11:31 AM, raj kumar
No, 2 Groups will be better because now a days 95% of the mails are
regarding companies, rather than mails part most of the people are joining
this group only because of this, because they are told by their friends that
here most recent Company interview Questions are posted.
1. Most of the
Shiva is right and that is the answer
*
if you try to change the values in a character array literal, the behavior
is undefined*
so on some compilers like Turbo C u may get o/p
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
I also Faced the same problem when i tried this one and when i got to know
the mistake it was not very happy :(
Use methods powl and log10l instead of pow and log10 and u will get 9 digits
of precision :)
On Tue, Oct 4, 2011 at 10:21 PM, gaurav yadav gauravyadav1...@gmail.comwrote:
n
There is a Website that was initiated after the success of its community
Algorithms on ORKUT
but if i will post the link here people will start spamming there also :P
like shady sad :(
People have taken this group from Algorithms Group to
X_Interview_Questions_Database_Group.
seriously Bad :(
, 2011 at 8:09 PM, sunny agrawal sunny816.i...@gmail.comwrote:
There is a Website that was initiated after the success of its community
Algorithms on ORKUT
but if i will post the link here people will start spamming there also :P
like shady sad :(
People have taken this group from Algorithms
For Last K Gene has posted the right Approach.
For First K
Hint : Logarithms log(N^N) = NlgN
On Tue, Oct 4, 2011 at 1:14 AM, Gene gene.ress...@gmail.com wrote:
I have not done this, so I'm not sure. But there are some tricks.
You can first break up the computation to exploit repeated
implement segment tree with lazy propagation :)
On Tue, Sep 27, 2011 at 1:19 PM, Aamir Khan ak4u2...@gmail.com wrote:
I am trying to solve http://www.spoj.pl/problems/LITE/ using segment tree.
Here's the code but i am getting TLE. Can somebody help me to optimize the
code ?
#includecstdio
I think it can be proved by contradiction that there does not exist a better
sorting algorithm than O(mnlogmn)
because if there is one then that means we can sort an array better than
O(nlgn) by assuming an array as 2D array of k rows and Ceiling(n/k) columns.
and if the elements belongs to some
let x be the number
initialize ans to some value like x or x/2
now repeatedly do the following
ans = (ans + x/ans)/2
each time you perform this operation you will move closer to the sqrt value
and depending upon the precision required stop
On Sat, Sep 24, 2011 at 11:17 PM, siddharth
Read CLRS
On Thu, Sep 15, 2011 at 11:51 PM, saurabh agrawal saurabh...@gmail.comwrote:
Building a max heap takes O(n) time irrespective of the array being sorted
/ unsorted.
Can someone prove that. I already know that Heap can be constucted in
o(n*log(n)) time.
--
You received this
is it like that all the square should be of same size ?
On Tue, Aug 2, 2011 at 11:54 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
Given a rectangle with known width and height, design an algorithm to fill
the rectangle using n squares(n is integer given) and make sure in the
result the
Radix sort is one of the solution.
because this Question is in the section Radix sort in CLRS. :)
On Tue, Aug 2, 2011 at 11:10 AM, Ravinder Kumar ravinde...@gmail.comwrote:
I have little thought on this :
divide the whole array by n and store their remainder also in an array
now number in
can be found in lg(n) using Matrix Exponential method
| 1 1 |^n
| 1 0 |
[f(i) f(i-1)]* |1 1| = [f(i+1) f(i)]
|1 0|
On Fri, Jul 29, 2011 at 12:05 PM, Reynald reynaldsus...@gmail.com wrote:
Write and implement an algorithm to find the nth Fibonacci number,
optimized for space
String need to be contiguous or not ?
On Fri, Jul 29, 2011 at 12:23 PM, AMAN AGARWAL mnnit.a...@gmail.com wrote:
please give the solution for this problem...
Give an algorithm to find the Longest common string of strings with lengths
m,n respectively and also analyse their time
No ans will be sum of all
final fib. number is the no of she-calves of age 0
second last is number is she-calves of age 1
...and so on
so answer is sum of all
On Fri, Jul 29, 2011 at 1:09 PM, Reynald Suz reynaldsus...@gmail.comwrote:
Shivnarayan, why should we add all Fibonacci number? Since
http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=alg_index
On Fri, Jul 29, 2011 at 1:31 PM, Rahul Menon menonrahul1...@gmail.comwrote:
@RAHUL SINGHAL
Sorry to bother you!
Unfortunately I cant find any such links in topcoder. Can you just share a
link here!
--
You received this
Array that that stores A,B,C,D,E.
it looks like u r on some telephonic interview :P
On Fri, Jul 29, 2011 at 3:06 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
Hi,
pls tell me which data structure has following representation::
A+Bx+Cx(^2)+Dx(^3)+...+Nx(^n-1).??
reply
, sunny agrawal
sunny816.i...@gmail.comwrote:
Array that that stores A,B,C,D,E.
it looks like u r on some telephonic interview :P
On Fri, Jul 29, 2011 at 3:06 PM, Puneet Gautam
puneet.nsi...@gmail.comwrote:
Hi,
pls tell me which data structure has following representation
Okay.
I was a bit wrongactually the thing is that
The exact number of bytes allocated for various C data types depends on *both
the machine and the compiler.**
*so it may be the that the compiler u are using is 32 bit..
one thing that u can try out is that on ubuntu install 64 bit
@Hemlatha
this is one of the possible solution
the Question is to find Number of such solutions
On Thu, Jul 28, 2011 at 12:09 PM, Hemalatha
hemalatha.amru...@googlemail.com wrote:
Give all the primary and secondary diagonal Elements a value -1 and the
rest as 1s.
-1 1 1 1 1 -1
1 -1 1 1
to get to the same answer?
On Thu, Jul 28, 2011 at 12:11 PM, sunny agrawal sunny816.i...@gmail.comwrote:
@Hemlatha
this is one of the possible solution
the Question is to find Number of such solutions
On Thu, Jul 28, 2011 at 12:09 PM, Hemalatha
hemalatha.amru...@googlemail.com wrote:
Give
Nice Problem :)
i think taking care of duplicates is very simple...but main point is
sorted insertion
that has to very carefully done
there are many cases that need to be taken care of
1. if the value to be inserted is between two nodes and both nodes are
fullthen a new node will be
Solution in the link is for BST, not for BT
On Thu, Jul 28, 2011 at 3:15 PM, kavitha nk kavithan...@gmail.com wrote:
http://geeksforgeeks.org/?p=1029
follow the link fa one more soln..
//BE COOL// kavi
--
You received this message because you are subscribed to the Google Groups
as Number of possible sets are nCk i think complexity of the best solution
will be O(k*nCk) (as in siddarths solution)
siddharth's solution will fail in case k 64
a simple recursive program is possible i think in same complexity.
On Thu, Jul 28, 2011 at 6:40 PM, Tushar Bindal
Okay... i was reading % as Modulus operator :(
did u gave the solution Nikhil posted , i think that should be the answer.
On Thu, Jul 28, 2011 at 9:10 PM, KK kunalkapadi...@gmail.com wrote:
@Nikhil: ya true but i dont know wht else was he expecting.
@sunny and Muthu: like suppose u pass
2 solutions - {1,2}
On Fri, Jul 29, 2011 at 11:10 AM, vaibhav_iiit honeys...@gmail.com wrote:
how many values of x are possible in the following equation.
x^(x^x) - (x^x)^x = 0
where a^b =power(a,b).
--
You received this message because you are subscribed to the Google Groups
Algorithm
Node* x = TREE_MINIMUM(root);
for(int i = 0; i k-1; i++){
x = TREE-SUCCESSOR(x);
}
return x;
On Fri, Jul 29, 2011 at 11:08 AM, noobcoder ase.as...@gmail.com wrote:
Iterative inorder of tree till you have traversed k elements. Last
element is the kth smallest.
On Jul 29, 10:10 am, AMAN
@shiva viknesh
this is a different Question...
@saurabh
how is nlgn possible, total no of possible substrings are n^2
this is the O(n^2) solutionOn Wed, Jul 27, 2011 at 8:09 AM, saurabh singh
for(int l = 0; l len; l++){
for(int i = 0; i len-l; i++){
There is a Book: Advance Programming in Unix Environment by Richard Stevens
in Chapter 2 i think there is a code that does the job of directory Listing
for given Directory
this is the code - for directory listing
*#include dirent.h
int main(int argc, char *argv[])
{
DIR *dp;
struct
suffix tree is constructed, needs to traverse in dfs order appending
the node found on the way.
total complexity would be O(construction of suffix tree ) + O(traverse
time).
surender
On Wed, Jul 27, 2011 at 12:00 PM, sunny agrawal
sunny816.i...@gmail.comwrote:
@shiva viknesh
yes Preorder recursion will be good for displaying in User Friendly way...
On Wed, Jul 27, 2011 at 12:49 PM, Anand Saha anands...@gmail.com wrote:
Implement Preorder Traversal in the File system tree.
--
On Wed, Jul 27, 2011 at 12:06 PM, geek forgeek geekhori...@gmail.comwrote:
Function
, 2011 at 12:46 PM, sunny agrawal
sunny816.i...@gmail.comwrote:
But still Printing O(N^2) substrings will take O(N^2) time isn't it ?
On Wed, Jul 27, 2011 at 12:39 PM, surender sanke surend...@gmail.comwrote:
@sunny
consider *uncompressed* suffix tree, even with distinct elements maximum
computer architecture !!!
64 bit machine has word size of 8 bytes so pointers are of 8 bytes
you never got size as 8 byte because u might be working on a 32 bit machine
!!
On Wed, Jul 27, 2011 at 2:18 PM, hary rathor harry.rat...@gmail.com wrote:
@sunny : what you means by machine dependent
Master theorem can be used when we know the recurrence relation.
You can read the 2nd Chapter of CLRS..
On Thu, Jul 28, 2011 at 1:16 AM, rajeev bharshetty rajeevr...@gmail.comwrote:
Masters Theorem
http://en.wikipedia.org/wiki/Master_theorem
On Thu, Jul 28, 2011 at 1:14 AM, NITIN
It dont look like a tree
its more like a triangle
and if the values are stored in the matrix can be simply done using a
Dynamic Programming bottom up approach
On Tue, Jul 26, 2011 at 2:27 PM, Charlotte Swazki
charlotteswa...@yahoo.frwrote:
Hi,
I want to implement an algorithm to determine
4+20+4 = 28 bytes it should be i think
On Tue, Jul 26, 2011 at 6:10 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
#includestdio.h
#includestddef.h
struct node{
int a;
char *b[5];
struct node *link;
};
main()
{
int a;
a=sizeof(struct node);
yes
on a 64 bit machine ans will be 4+5*8+8 = 52 bytes
pointers take 8 byte on 64 bit machine
On Tue, Jul 26, 2011 at 8:00 PM, vaibhav shukla vaibhav200...@gmail.comwrote:
will there be any difference in size on 32 machine and on 64 bit machine ?
how and what ?
On Tue, Jul 26, 2011 at 7:58
First Thing is that i will support Shady's point.
Please Post the question and the idea u r trying to solve the
questionnot the complete Code so that algorithm can be discussed here
and then u can identify your mistake.
because this happens most of the time when someone posts code,
For N=3, if the people are named A,B, and C:
A wears the shoes and carries B across the river.
is there any condition that one can carry only one with him?
On Tue, Jul 26, 2011 at 10:02 AM, Someshwar Chandrasekaran
somseka...@gmail.com wrote:
On Tue, Jul 26, 2011 at 3:19 AM, Don
char five[7] - string of length 7
charlie - 7 length string
declare it as char[8] u will get expected output
On Sun, Jul 24, 2011 at 12:15 PM, Anurag atri anu.anurag@gmail.comwrote:
yup , on ideone it indeed is giving the output you suggested ..
On Sun, Jul 24, 2011 at 12:10 PM,
'\0'... isn't it ?
On Sun, Jul 24, 2011 at 12:25 PM, sunny agrawal
sunny816.i...@gmail.comwrote:
char five[7] - string of length 7
charlie - 7 length string
declare it as char[8] u will get expected output
On Sun, Jul 24, 2011 at 12:15 PM, Anurag atri
anu.anurag@gmail.comwrote
@atul
Your algo is not stable
http://www.ideone.com/DrV5J
BTW what are u trying to do
instead of posting a code please prefer posting a simple algorithm in text
coding part is very easy once the correct algorithm is found
On Fri, Jul 22, 2011 at 11:43 AM, Puneet Gautam
left to it are even and right odd.Its an implementation of quick sort as
discussed earlier.Its o(n) no doubt but its not stable.
On Fri, Jul 22, 2011 at 11:51 AM, sunny agrawal
sunny816.i...@gmail.comwrote:
@atul
Your algo is not stable
http://www.ideone.com/DrV5J
BTW what are u trying
1 - 100 of 326 matches
Mail list logo