may be bcoz they(auto) are stored in stack
On Thu, Sep 29, 2011 at 10:05 PM, tech rascal techrascal...@gmail.comwrote:
--
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
consider the length of list1 is 7(ie m) and length of list2 is 5 (ie n)..now
find (m-n) ie 7-5=2..since length of list2 is smaller than list1,,have a
pointer pointing to the head of the list2 and move that pointer (m-n)
positions ie (here 2 positions)..now have a pointer pointing to the head of
@ Decipher:
Q1) find where the rotation begins and do binary search in the first half or
the second half depending upon the search element
On Sun, Sep 25, 2011 at 8:58 PM, Decipher ankurseth...@gmail.com wrote:
Q1) A sorted array is rotated unknown number of times , write an algorithm
to
Given a binary search tree, design an algorithm which creates a linked list
of all the nodes at each depth (i.e., if you have a tree with depth D,
you’ll have D linked lists).
--
*prasanth*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
anyone give an algorithm of how to convert a binary search tree into a
linkedlist
--
*prasanth*
--
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,
@sukran:
must do it in place..
On Wed, Sep 21, 2011 at 7:01 PM, sukran dhawan sukrandha...@gmail.comwrote:
do BFS search,at each level make a linked list
On Wed, Sep 21, 2011 at 6:50 PM, prasanth n nprasnt...@gmail.com wrote:
anyone give an algorithm of how to convert a binary search tree
You have given a positive number you have to find a number which is bigger
than that by using same digits available in the number .
Example :-
You have given a number 7585 , your output should be 7855 .
--
*prasanth*
--
You received this message because you are subscribed to the Google Groups
In the classic problem of the Towers of Hanoi, you have 3 rods and N disks
of different sizes which can slide onto any tower. The puzzle starts with
disks sorted in ascending order of size from top to bottom (e.g., each disk
sits on top of an even larger one). You have the following constraints:
@don:
yes it think
On Tue, Sep 20, 2011 at 11:00 PM, Don dondod...@gmail.com wrote:
Does the call stack count as a stack?
Don
On Sep 20, 12:27 pm, prasanth n nprasnt...@gmail.com wrote:
In the classic problem of the Towers of Hanoi, you have 3 rods and N
disks
of different sizes which
{
move(n-1, from, use, to);
move(1, from , to, use);
move(n-1, use, to, from);
}
}
int main(int argc, char* argv[])
{
const int n = 5;
move(n, 1, 2, 3);
return 0;
}
On Sep 20, 12:37 pm, prasanth n nprasnt...@gmail.com wrote:
@don
You are given a binary tree in which each node contains a value. Design an
algorithm to print all paths which sum up to that value. Note that it can be
any path in the tree - it does not have to start at the root.
--
*prasanth*
--
You received this message because you are subscribed to the
anyone give an algorithm of how to generate a random number..probability of
occurrence of each no should be the same..
--
*prasanth*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@teja:
if we use call by value in copy constructor,,
class base
{
int a;
public:
base(int x)
{
a=x;
}
base(base c)
{
}
};
int main()
{
base b(1);
base b1=b;// this ll be seen as base c=b(see the copy constructor)..this ll
in turn call another copy constructor..
return 0;
}
now it ll create
@don:
can u give the algorithm??
On Mon, Sep 19, 2011 at 10:37 PM, praveen raj praveen0...@gmail.com wrote:
Use trie.
On 19-Sep-2011 8:20 PM, Sangeeta sangeeta15...@gmail.com wrote:
given an array of characters without spaces and a dictionary.All valid
dictionary words must be found and
You are given a binary tree in which each node contains a value. Design an
ALGORITHM to print all paths which sum up to that value. Note that it can be
any path in the tree - it does not have to start at the root.
--
*prasanth*
--
You received this message because you are subscribed to the
given a matrix with +ve and -ve numbers, find the submatrix with maximum
sum??
--
*prasanth*
--
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,
abt the subarray element instead it
tells abt max sum of subarray . to get the element of subarray store the
end_offset whenever your max_sum changes .
On Sat, Sep 17, 2011 at 4:47 PM, sukran dhawan sukrandha...@gmail.comwrote:
kadane s algo
On Sat, Sep 17, 2011 at 3:25 PM, prasanth n
(The element which make largest sum is\t);
for(j=s;j=e;j++)
{
printf(%d\t,a[j]);
}
}
int main() {
int a[]={6,4,-5,5,2,8,-21,15,4};
int n=9;
largestsum(a,n);
return 0;
}
Thanks Regards
Sinjan
M.Tech(s/w engg)
DTU delhi
On Sep 17, 2:55 pm, prasanth n nprasnt
You are given a binary tree in which each node contains a value. Design an
ALGORITHM to print all paths which sum up to that value. Note that it can be
any path in the tree - it does not have to start at the root.
--
*prasanth*
--
You received this message because you are subscribed to the
@sarath:
it is not specified that the range is from 1 to n..it may look like this:
1 99 2 99
here you cant access a[99]..
On Fri, Sep 16, 2011 at 7:28 PM, sarath prasath prasathsar...@gmail.comwrote:
this is one is the elegant solution i came across
if u got an element just go to the
can anyone tell how to implement a hash table in C?? how to choose the hash
function?? algorithm??
--
*prasanth*
--
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
Given an infinite number of quarters (25 cents), dimes (10 cents), nickels
(5 cents) and pennies (1 cent), write code to calculate the number of ways
of representing n cents.
also do give an algorithm first..
--
*prasanth*
--
You received this message because you are subscribed to the Google
;
On Sep 16, 1:35 pm, prasanth n nprasnt...@gmail.com wrote:
Given an infinite number of quarters (25 cents), dimes (10 cents),
nickels
(5 cents) and pennies (1 cent), write code to calculate the number of
ways
of representing n cents.
also do give an algorithm first..
--
*prasanth
use dynamic programming..
On Sun, Sep 4, 2011 at 6:46 PM, aditya kumar
aditya.kumar130...@gmail.comwrote:
How to find longest common substring in two strings ?
i want efficent code and iff possible any method other than using suffix
tree .
--
You received this message because you are
how to implement a stack(push and pop) using binary search tree??
--
*prasanth*
--
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
@ankur:
i think its error..l value required
On Wed, Aug 24, 2011 at 11:18 PM, Ankur Garg ankurga...@gmail.com wrote:
Hi
Suppose there is a program
int main(){
printf(%t,main());
sleep(1000);
return 0;
}
The above program is run from 100 different windows
What will be the
miles before as it is on its normal time, so no change in its position.
then, when the cyclist covers that 1 mile, the train covers 5 miles so that
both of them meet at the station.
thus, speed of the train = 5*speed of cyclist = 60 miles/hour
On Sun, Aug 21, 2011 at 12:19 PM, prasanth n nprasnt
@vicky
written:
3 c and ds multiple choice questions
2 java questions
1 dbms
1 c++
5 coding quesions..
1) you will be given 2 binary tree..you have to find the intersecting node..
2) rotating an image by 90 degree..
that all i remember..
round 1:
1*) rotating *a linked list..only recursion and
@sourabh jakhar:
how to design that big int class?? what data structure to use??
On Sun, Jul 17, 2011 at 3:55 PM, sourabh jakhar sourabhjak...@gmail.comwrote:
i donot know abt the results but one thing for sure get your basic first
right and than do the weird question
On Sun, Jul 17, 2011
.
On Sun, Jul 17, 2011 at 5:28 PM, sagar pareek sagarpar...@gmail.comwrote:
@prasanth
Trie will be used... :) :)
On Sun, Jul 17, 2011 at 5:28 PM, sagar pareek sagarpar...@gmail.comwrote:
@saurabh
Ok...
on 20th amazon is coming :)
On Sun, Jul 17, 2011 at 4:35 PM, prasanth n
@sagar pareek:
thanks
On Sun, Jul 17, 2011 at 6:50 PM, sagar pareek sagarpar...@gmail.com wrote:
yeah it can be
On Sun, Jul 17, 2011 at 6:47 PM, prasanth n nprasnt...@gmail.com wrote:
@sagar pareek:
we cant use linked list ah??
On Sun, Jul 17, 2011 at 6:44 PM, sagar pareek sagarpar
31 matches
Mail list logo