p[i] maintains previous index from which b[i] has reached longest sequence
till i.
to get the actual list of non-decrease sequence, p has to be traversed
through back indices
for (u = b.size(), v = b.back(); u--; v = p[v]) b[u] = v;
surender
On Sat, Jul 16, 2011 at 9:06 AM, Neeraj Gupta
Someone please reply.
--
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/-/vBP5ZdFV9HEJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
Reply for what?
On Sat, Jul 16, 2011 at 1:07 PM, Nitish Garg nitishgarg1...@gmail.comwrote:
Someone please reply.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
for problem1 you can use %hi or %hd .. while scanning ..
On Thu, Jul 14, 2011 at 12:03 PM, Gaurav Jain gjainroor...@gmail.comwrote:
@Nicks
*Problem 1*
%d is used to take a signed integer as input. To take a short integer as
input, use %hi. That way, you would get the correct answer as 2.
OK :)
On Sat, Jul 16, 2011 at 2:32 AM, Divye Kapoor divyekap...@gmail.com wrote:
@Sagar: You misunderstand my concern.
When I say hash collisions, I mean:
Consider 2 very different images X and Y - both have the same hash value H.
Such X and Y will always exist because you're mapping a
@Kamakhsi
In my ubuntu gcc this o/p is coming with warning of undefined %# :)
On Sat, Jul 16, 2011 at 5:43 AM, sukhmeet singh sukhmeet2...@gmail.comwrote:
@Anatony
the output will be compiler dependent
res1 is not defined .. as C don't allow to change the value of a variable
more than
and o/p is %#s Zi not %s Zi
On Sat, Jul 16, 2011 at 2:18 PM, sagar pareek sagarpar...@gmail.com wrote:
@Kamakhsi
In my ubuntu gcc this o/p is coming with warning of undefined %# :)
On Sat, Jul 16, 2011 at 5:43 AM, sukhmeet singh sukhmeet2...@gmail.comwrote:
@Anatony
the output will
tell me your output pls
On Sat, Jul 16, 2011 at 2:19 PM, sagar pareek sagarpar...@gmail.com wrote:
and o/p is %#s Zi not %s Zi
On Sat, Jul 16, 2011 at 2:18 PM, sagar pareek sagarpar...@gmail.comwrote:
@Kamakhsi
In my ubuntu gcc this o/p is coming with warning of undefined %# :)
@Antony
res1=++a + ++a + ++a;
Well it depends on the compiler but i know how gcc works :)
from left to right it will first do addition of first two 'a'
before addition it will increment the value of a by two cos of two pre
increments.
then resulting addition will then be added to the incremented
Q2. Given m arrays of n size each, give an algorithm to combine these arrays
into a single array with sorted elements. Also tell the time complexity of
your solution.
Aseem
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
Printf(“%d”,printf(“%d %d”,2,2) printf(“%d %d ”, 2, 2));
--
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
Because here we can not reOrder words, Greedy seems to work fine to me too,
i am not able to come up with an contradictory example..will post if
will get one... or post if any one can.
but here http://mitpress.mit.edu/algorithms/solutions/chap15-solutions.pdfis
the DP solution to the
2
On Sat, Jul 16, 2011 at 2:51 PM, shiv narayan narayan.shiv...@gmail.comwrote:
Printf(“%d”,printf(“%d %d”,2,2) printf(“%d %d ”, 2, 2));
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
There is an infinitesimally small probability that it will continue to
run forever. But I tested it for 10,000 runs and it ran in a flash on
my archaic machine (5yrs old is archaic probably :) )
int generateRand()
{
int num = 1;
for(int i=0;i10;i++)
{
int
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul swetharahu...@gmail.comwrote:
2
On Sat, Jul 16, 2011 at 2:51 PM, shiv narayan
narayan.shiv...@gmail.comwrote:
Printf(“%d”,printf(“%d %d”,2,2) printf(“%d %d ”, 2, 2));
Well if there is a space btween the two %d's dn it should be 2 2 2 23
Otherwise fine.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul
@Dave - Nice solution :)
On Jul 10, 4:42 pm, Dave dave_and_da...@juno.com wrote:
@Anurag:
Seehttp://groups.google.com/group/algogeeks/msg/d90353c759125384?hl=en.
Dave
On Jul 10, 1:14 am, anurag anurag19aggar...@gmail.com wrote:
You are given two integers n and k
k signifies number of
answer for first should be
2 22 23
and for second
2 222
2
correct me if i am wrong.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul
according to me it processing is done from righ to left .first right
most a would be incremented and then from righ to left
for first question answer should be 8+7+6=21
and for 2nd it should be
(8)+(7)*10+(6)*100=678
On Jul 15, 1:15 pm, Antony Kotre antonyko...@gmail.com wrote:
can any tell and
I am using MinGW compiler (codeblocks , out put is 788 and not 678 . Its
compiler dependent so , let us leave it that way only.
On Sat, Jul 16, 2011 at 3:27 PM, shiv narayan narayan.shiv...@gmail.comwrote:
according to me it processing is done from righ to left .first right
most a would
Use divide and conquer. take 2 array at a time and .so you are merging two
array at a time.
num_of_list=m;
length of list=n;
while(num_of_list 1)
{
while( (num of list where length = length_of_list) 2)
{
merge two lists of length (length_of_list);
}
if(num_of_list %2==0)
num_of_list/=2;
else
Divide the image into 1000x1000 grid. Compute and store hash of each
individual cell. Now, compare hashes of cells instead. Assuming each
hash is 16 bytes, it takes additional ~ 16 MB of memory, but the time
required to localize the point of change is reduced by a factor of
10^6.
To reduce the
i have solution with no extra space complexity but time complexity is O(n)
traverse the list with a pointer ptr
if odd no encounter then traverse the remaining list with tmp pointer with
start point ptr-next and match the numbers with iti hope it works :)
On Sat, Jul 16, 2011 at 10:10 AM,
Given a Parent -Child binary tree ,build the child -sibling version of
it?
Minimize the space requirements wherever possible.
--
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
yup :)
On Sat, Jul 16, 2011 at 4:17 PM, Nishant Mittal
mittal.nishan...@gmail.comwrote:
@sagar it will take O(n2) if all the elements of linked list are odd and
distinct..
On Sat, Jul 16, 2011 at 4:06 PM, sagar pareek sagarpar...@gmail.comwrote:
i have solution with no extra space
@sagar it will take O(n2) if all the elements of linked list are odd and
distinct..
On Sat, Jul 16, 2011 at 4:06 PM, sagar pareek sagarpar...@gmail.com wrote:
i have solution with no extra space complexity but time complexity is O(n)
traverse the list with a pointer ptr
if odd no
sort all the arrays first O(nlogn)
then use merge sort
On Sat, Jul 16, 2011 at 3:43 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
Use divide and conquer. take 2 array at a time and .so you are merging two
array at a time.
num_of_list=m;
length of list=n;
while(num_of_list 1)
{
oops , didnt see the unsorted thing. complexity is mnlog(n) + mn log(m)
On Sat, Jul 16, 2011 at 4:23 PM, sagar pareek sagarpar...@gmail.com wrote:
sort all the arrays first O(nlogn)
then use merge sort
On Sat, Jul 16, 2011 at 3:43 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
Use
@sagar ya this is brute force
On Sat, Jul 16, 2011 at 4:19 PM, sagar pareek sagarpar...@gmail.com wrote:
yup :)
On Sat, Jul 16, 2011 at 4:17 PM, Nishant Mittal
mittal.nishan...@gmail.com wrote:
@sagar it will take O(n2) if all the elements of linked list are odd and
distinct..
On
always state one input output while asking questions sample
input-output ?
On Sat, Jul 16, 2011 at 4:16 PM, Reynald reynaldsus...@gmail.com wrote:
Given a Parent -Child binary tree ,build the child -sibling version of
it?
Minimize the space requirements wherever possible.
--
You
@ankur that's right :)
On Sat, Jul 16, 2011 at 3:25 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
answer for first should be
2 22 23
and for second
2 222
2
correct me if i am wrong.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
the ans to first should be 2 2 2 2 0.
and the and to second should be.
222 2
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 4:57 PM, shady sinv...@gmail.com wrote:
@ankur that's right :)
On Sat, Jul 16, 2011 at 3:25 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
answer for
please ignore my previous post.
On Sat, Jul 16, 2011 at 5:38 PM, varun pahwa varunpahwa2...@gmail.comwrote:
the ans to first should be 2 2 2 2 0.
and the and to second should be.
222 2
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 4:57 PM, shady sinv...@gmail.com wrote:
ignore my previous result.
the ans to first should be 2 22 2 0.
and the ans to second should be.
2 222
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 5:38 PM, varun pahwa varunpahwa2...@gmail.comwrote:
the ans to first should be 2 2 2 2 0.
and the and to second should be.
222 2
how about using voters algorithm? TC O(n) and SC O(1)
On Jul 16, 6:28 am, 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
If the there are problems with hashing method,
What about simply sorting the numbers then comparing the adjacent numbers
!
Time complexity O(nlogn)+O(n)=O(nlogn)
Cheers!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this
how does ur algo produce sorted elements in final array?
On Jul 16, 3:55 pm, Ankur Khurana ankur.kkhur...@gmail.com wrote:
oops , didnt see the unsorted thing. complexity is mnlog(n) + mn log(m)
On Sat, Jul 16, 2011 at 4:23 PM, sagar pareek sagarpar...@gmail.com wrote:
sort all the
Algo to find the border of a given binary tree. Optimized for space
and time.
Input:
10
/ \
50 50
/ \ / \
25 75 20020
/ \ / /\
15 35 120155 250
Output:50 25 15 35 120 155 250 20 150 10
--
You received this
@Anand: Assuming that the file contains unsigned 32-bit integers. Set
an integer array a[65536] to zero, read through the file and tally the
numbers based on their low-order 16 bits: a[j0x]++. Since 4.3
billion exceeds 2^32, by the pigeonhole principle, there will be at
least one tally, say
Given a BST containing integers, and a value K. You have to find two
nodes that give sum = K.
--
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
Given a BST containing integers, and a value K. You have to find two
nodes that give sum = K.
--
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
Check
https://groups.google.com/group/algogeeks/browse_thread/thread/e8735bcdbf4c956/c49018d0eac8070b?hl=enlnk=gstq=saurabh8c#c49018d0eac8070b
On Sat, Jul 16, 2011 at 7:50 PM, noobcoder ase.as...@gmail.com wrote:
Given a BST containing integers, and a value K. You have to find two
nodes that
convert into doubly linked list and than apply simple algo of finding two
element with a sum
On Sat, Jul 16, 2011 at 7:54 PM, saurabh singh saurab...@gmail.com wrote:
Check
you sort array before merging. and then use merge sort
On Sat, Jul 16, 2011 at 6:53 PM, noobcoder ase.as...@gmail.com wrote:
how does ur algo produce sorted elements in final array?
On Jul 16, 3:55 pm, Ankur Khurana ankur.kkhur...@gmail.com wrote:
oops , didnt see the unsorted thing.
can be done in NlogN take a node, say 'a' check if k-a exists in the
tree(logN)
On Sat, Jul 16, 2011 at 7:58 PM, sourabh jakhar sourabhjak...@gmail.comwrote:
convert into doubly linked list and than apply simple algo of finding two
element with a sum
On Sat, Jul 16, 2011 at 7:54 PM, saurabh
@Noobcoder: To do it in O(n) without destroying the BST, do two
inorder traversals simultaneously, one in the normal forward (left
subtree first) direction and one in the reverse direction (right
subtree first). Let the two current nodes have value F and R
respectively. If F + R = K, return
@Aseem: Combine the arrays and sort the result. O(mn log mn).
Dave
On Jul 16, 4:13 am, aseem garg ase.as...@gmail.com wrote:
Q2. Given m arrays of n size each, give an algorithm to combine these arrays
into a single array with sorted elements. Also tell the time complexity of
your solution.
@dave
what if the k= root-left + right most leaf ?
how ur algo works on it?
On Sat, Jul 16, 2011 at 9:28 PM, Dave dave_and_da...@juno.com wrote:
@Noobcoder: To do it in O(n) without destroying the BST, do two
inorder traversals simultaneously, one in the normal forward (left
subtree first)
@Sagar: No problem. The algorithm would do only forward traversal
steps until it got to root_left, whereupon F + R = K.
Dave
On Jul 16, 11:40 am, sagar pareek sagarpar...@gmail.com wrote:
@dave
what if the k= root-left + right most leaf ?
how ur algo works on it?
On Sat, Jul 16, 2011 at
Q.1 what is the output of following program?
#include iostream
using namespace std;
class A
{
public:
A()
{ coutConstructing Aendl;
}
~A()
{ coutDestructing Aendl;
}
};
class B : public A
{
public:
B()
ok i got it
actually u written wrong that f/w and reverse traversal are running
parallel
u must wrote that f/w traversal inside reverse or vice versa
On Sat, Jul 16, 2011 at 10:35 PM, Dave dave_and_da...@juno.com wrote:
@Sagar: No problem. The algorithm would do only forward traversal
Output of 1st is
constructing A
constructing B
destructing *A*
*
*
as destructor is not virtual only the base class destructor is called and
during object creation first base class constructor is called then derived
class during the derived class object creation.
output of 2nd :
the object of
HI,
Q1: Destructor of B is not called because it doesn't have Run time type
information as there is no virtual function.
By have a declaration like A *b= new B(); Application only know that type
of object b is A so when this object get destroyed, only Class A destructor
is called.
Q2:
@Sagar: No. I didn't say that they were in parallel or that one was
inside the other. Go back and read it again and you will see that I
said that they were being performed simultaneously, with each one
being advanced in certain circumstances, and that in order to do that
you would have to use
and so it must not be O(n)
On Sat, Jul 16, 2011 at 10:54 PM, sagar pareek sagarpar...@gmail.comwrote:
ok i got it
actually u written wrong that f/w and reverse traversal are running
parallel
u must wrote that f/w traversal inside reverse or vice versa
On Sat, Jul 16, 2011 at 10:35 PM,
Ok may be i m not getting ur logic...
On Sat, Jul 16, 2011 at 11:03 PM, Dave dave_and_da...@juno.com wrote:
@Sagar: No. I didn't say that they were in parallel or that one was
inside the other. Go back and read it again and you will see that I
said that they were being performed
@Sagar: The algorithm visits each node at most 3 times: Once when
descending from its parent, once when ascending from its left child,
and once when ascending from its right child. Furthermore, one node is
eliminated from contention with every three comparisons of F with R.
Thus, there are no more
@Sagar: If you are not getting my logic, ask a question.
Dave
On Jul 16, 12:35 pm, sagar pareek sagarpar...@gmail.com wrote:
Ok may be i m not getting ur logic...
On Sat, Jul 16, 2011 at 11:03 PM, Dave dave_and_da...@juno.com wrote:
@Sagar: No. I didn't say that they were in parallel or
You must take an example and then explain
On Sat, Jul 16, 2011 at 11:59 PM, Dave dave_and_da...@juno.com wrote:
@Sagar: If you are not getting my logic, ask a question.
Dave
On Jul 16, 12:35 pm, sagar pareek sagarpar...@gmail.com wrote:
Ok may be i m not getting ur logic...
On
@sagain:in dev c it is
#s Zi
On Sat, Jul 16, 2011 at 3:35 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
I am using MinGW compiler (codeblocks , out put is 788 and not 678 . Its
compiler dependent so , let us leave it that way only.
On Sat, Jul 16, 2011 at 3:27 PM, shiv narayan
answer to the first should be 2 22 23
On Sat, Jul 16, 2011 at 5:44 PM, varun pahwa varunpahwa2...@gmail.comwrote:
ignore my previous result.
the ans to first should be 2 22 2 0.
and the ans to second should be.
2 222
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 5:38 PM,
Give reason not answer . Answer can be found by compiler
On Sun, Jul 17, 2011 at 12:38 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
answer to the first should be 2 22 23
On Sat, Jul 16, 2011 at 5:44 PM, varun pahwa varunpahwa2...@gmail.comwrote:
ignore my previous result.
the ans
here is the code
void border(node*);
void recur(node*);
void border(node *ptr)
{
node* tmp; int stack[20],top=0;
if(tmp=ptr-left)
{
while(tmp-left)
{
printf(%d ,tmp-data);
tmp=tmp-left;
}
}
recur(ptr);
if(tmp=ptr-right)
{
while(tmp-right)
{
stack[top++]=tmp-data;
@gaurav :y it is -2?y not +2?
On Sat, Jul 16, 2011 at 2:13 PM, sukhmeet singh sukhmeet2...@gmail.comwrote:
for problem1 you can use %hi or %hd .. while scanning ..
On Thu, Jul 14, 2011 at 12:03 PM, Gaurav Jain gjainroor...@gmail.comwrote:
@Nicks
*Problem 1*
%d is used to take a signed
@Reynald
Will 75 not be included in the tree that u have
given..??
On Sun, Jul 17, 2011 at 12:49 AM, sagar pareek sagarpar...@gmail.comwrote:
here is the code
void border(node*);
void recur(node*);
void border(node *ptr)
{
node* tmp; int stack[20],top=0;
according to saagar's algo, it'll be printed ...
On Sun, Jul 17, 2011 at 1:02 AM, swetha rahul swetharahu...@gmail.comwrote:
@Reynald
Will 75 not be included in the tree that u have
given..??
On Sun, Jul 17, 2011 at 12:49 AM, sagar pareek
yup :)
On Sun, Jul 17, 2011 at 1:03 AM, Shubham Maheshwari
shubham.veloc...@gmail.com wrote:
according to saagar's algo, it'll be printed ...
On Sun, Jul 17, 2011 at 1:02 AM, swetha rahul swetharahu...@gmail.comwrote:
@Reynald
Will 75 not be included in the
printf returns no of characters printed..first of all the rightmost printf
will print 2 2 .and since it is printing 3 characters(two 2's and 1 space)
thereby its returning 3.same is with the other printf..now the outer most
printf will print the value of(3 3) which is 3..and hence the answer.
On
Sagar , Shubam Maheshwari
Thanks!!
On Sun, Jul 17, 2011 at 1:11 AM, sagar pareek sagarpar...@gmail.com wrote:
yup :)
On Sun, Jul 17, 2011 at 1:03 AM, Shubham Maheshwari
shubham.veloc...@gmail.com wrote:
according to saagar's algo, it'll
void convert(Node * root, Node* sibling) {
if(root == NULL) return;
convert(root-left, root-right);
convert(root-right, NULL);
root-right = sibling;
}
convert(root, NULL);
--
DK
http://twitter.com/divyekapoor
http://www.divye.in
--
You received this message because you are
union Data Type
What is the output of the following program? Why?
#include
main() {
typedef union {
int a;
char b[10];
float c;
}
Union;
Union x,y = {100};
x.a = 50;
strcpy(x.b,hello);
x.c = 21.50;
printf(Union x : %d %s %f n,x.a,x.b,x.c);
printf(Union y : %d %s %f n,y.a,y.b,y.c);
}
--
Shubham
I think you must first read about unions and the differences between union
and structures :)
On Sun, Jul 17, 2011 at 1:48 AM, Shubham Maheshwari
shubham.veloc...@gmail.com wrote:
union Data Type
What is the output of the following program? Why?
#include
main() {
typedef union {
int a;
you mean to say .. the ques is wrong ... or what ...!!
On Sun, Jul 17, 2011 at 1:54 AM, sagar pareek sagarpar...@gmail.com wrote:
I think you must first read about unions and the differences between union
and structures :)
On Sun, Jul 17, 2011 at 1:48 AM, Shubham Maheshwari
u can always retrieve that value from the union that has been assigned
last.therefore u get correct answer only for x.c
in the case of union y
y.a=100 and so the output
but am not sure why y.b is printing character equivalent of 100.
On Sun, Jul 17, 2011 at 1:58 AM, Shubham Maheshwari
@Kamakshii:
thats probably becuz a union has a common memory location, accessed by all
its members.
so, the value '100' is treated as an int by 'a', as a char array by 'b' and
as a float by 'c'.
I thnk i read this read tis somewhere sometime back. ... so aint completely
sure abt it.
On Sun, Jul
@shubham:yes u r right.thanks :)
On Sun, Jul 17, 2011 at 2:12 AM, Shubham Maheshwari
shubham.veloc...@gmail.com wrote:
@Kamakshii:
thats probably becuz a union has a common memory location, accessed by all
its members.
so, the value '100' is treated as an int by 'a', as a char array by 'b'
Well shubham if you know about the unions very well then why u asked this
question?
On Sun, Jul 17, 2011 at 2:27 AM, Shubham Maheshwari
shubham.veloc...@gmail.com wrote:
:D
On Sun, Jul 17, 2011 at 2:24 AM, Kamakshii Aggarwal kamakshi...@gmail.com
wrote:
@shubham:yes u r right.thanks :)
A pre-order traversal which is used to index the (min,max) pair value
at each level except the bottom-most level where all the entries are
to be printed. O(n) time O(log n) memory.
On 7/17/11, swetha rahul swetharahu...@gmail.com wrote:
Sagar , Shubam Maheshwari
Use O(2n) memory , list the in-order traversal of BST say A[0..n].
and K-A[0...n] say B . Now apply standard merge function(Merge sort)
on A and B. keeping track of equal found elements during comparison to
get the ans.
On 7/17/11, sagar pareek sagarpar...@gmail.com wrote:
You must take an
@sagar This is what Dave is suggesting in a more pseudocode way:-
1-Traverse a pointer right down to the leftmost element,i.e.the
shortest,say small
2-traverse a pointer left down to the rightmost element i.e.the
largest.say
large
while(small!=large)
3-Compare their sum.If sumk set large to its
Sagar;s Algo works, thank you so much guys.
On Sun, Jul 17, 2011 at 3:41 AM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote:
A pre-order traversal which is used to index the (min,max) pair value
at each level except the bottom-most level where all the entries are
to be printed. O(n) time O(log n)
Yep!
On Sun, Jul 17, 2011 at 1:02 AM, swetha rahul swetharahu...@gmail.comwrote:
@Reynald
Will 75 not be included in the tree that u have
given..??
On Sun, Jul 17, 2011 at 12:49 AM, sagar pareek sagarpar...@gmail.comwrote:
here is the code
void border(node*);
please explain the code a bit more.. unable to understand it..an example
will be better..
On Sun, Jul 17, 2011 at 7:10 AM, Reynald Suz reynaldsus...@gmail.comwrote:
Yep!
On Sun, Jul 17, 2011 at 1:02 AM, swetha rahul swetharahu...@gmail.comwrote:
@Reynald
Will 75
value of b = 10 (in binary) and since b is a signed integer and also MSB is
1 so final value of b is 2's complement of 10 i.e. -2
On Sun, Jul 17, 2011 at 12:55 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
@gaurav :y it is -2?y not +2?
On Sat, Jul 16, 2011 at 2:13 PM, sukhmeet singh
It depends upon problem
if n m, apply insertion sort for sorting m arrays because for
smaller sublists insertion sort perform better then merge sort and
then merge them all in mnlog(m)
otherwise simply combine and apply merge sort or any other standard
sorting algorithm
On Sat, Jul 16, 2011 at
@sagar: There is one flaw in the code. Trace ur code 15 and 250 get printed
twice. otherwise it is fine.
On Sat, Jul 16, 2011 at 7:59 PM, sukhmeet singh sukhmeet2...@gmail.comwrote:
please explain the code a bit more.. unable to understand it..an example
will be better..
On Sun, Jul 17,
im a bit confused with child-sibling term, this expects output for
A
/\
B C
/ \ / \
DE F G
1
A
/
B C
/ /
DE FG
2 A
/
B-- C
/
DEFG
is output expected 1 or 2
in this recursive code...the right link node will point to its sibling
to the right (if it has) or else it will be null.
the left link of the node will point to its child(if it has) or else
it will be null.
regards,
Naveen
CSE
R.V.C.E, Bangalore.
--
You received this message because you are
88 matches
Mail list logo