struct node* intersection( struct node *pL1, struct node* pL2)
{
if ((!pL1) || (!pl2)) return NULL;
struct node * pL3 = NULL;
struct node* pL3Tail = NULL;
while(pL1)(pL2) {
if (pL1-data pL2-data) pL1=pL1-next;
else if (pL1-data pL2-data) pL2=pL2-next;
else {
struct
@nishant, you wrote until both the distance becomes equal.Which distances
? Could you please elaborate ?
On Thu, Jul 5, 2012 at 12:52 PM, Ashish Goel ashg...@gmail.com wrote:
struct node* intersection( struct node *pL1, struct node* pL2)
{
if ((!pL1) || (!pl2)) return NULL;
struct node
Hope the following will be of help:
http://www.geeksforgeeks.org/archives/18615
regds.
On Thu, Jul 5, 2012 at 4:32 PM, Abhishek Sharma abhi120...@gmail.comwrote:
@nishant, you wrote until both the distance becomes equal.Which
distances ? Could you please elaborate ?
On Thu, Jul 5, 2012 at
both the distance means distance between the two linked list some thing
like this :
struct node *temp1,*temp2;
temp1 = head1;
temp2 = head2;
int l1 = get_dist(head1);
int l2 = get_dist(head2);
int ds = abs(l1-l2);
if( l1 l2 )
{
for(int i=0;ids;i++)
{
First define all the basic operation you can apply on two numbers.
Binary operation : +, -, *, /, %, optional((and), |(or), ^(xor))
Unary operation : !, ~, -
Comparison : , ==, !=
Define all these operation.
Most simplest one can be,
class BIG_INT {
private string val;
//Define
thnx...4 d rply..
Regards,
PAYAL GUPTA,
NIT-B.
On Fri, Jul 6, 2012 at 12:43 AM, Anshu Mishra anshumishra6...@gmail.comwrote:
First define all the basic operation you can apply on two numbers.
Binary operation : +, -, *, /, %, optional((and), |(or), ^(xor))
Unary operation : !, ~, -
here is a recursive method. First sort the two list and use the following
algo.
initial value of third parameter is NULL.
struct node *sortedIntersect(struct node *a, struct node *b,
struct node *result)
{
/* base case */
if(a == NULL || b == NULL)
{
here is an recursive method the two linked list have to be in sorted
order.
struct node *sortedIntersect(struct node *a, struct node *b,
struct node *result)
{
/* base case */
if(a == NULL || b == NULL)
{
return NULL;
}
/* If both
@Navin : Why r u sorting the array .. BST can be made using the preorder
traversal if null nodes are well defined in the given traversal.. Right??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
??
--
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/-/HQ_TvoKSLNgJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this
@Navin : Read a line .. store it in a string .. then extract numbers frm
it.. It will be more faster i think.. :)
On Wednesday, 4 July 2012 22:44:04 UTC+5:30, Navin Kumar wrote:
Suppose a file.txt contains : 50 40 30 # # 5 # 10 # #
i want to fetch only integers. How should i fetch it. I
Given a list of people and music bands they like, two people are compatible
if they have at least 2 bands in common. The compatibility of two people is
directly proportional to the number of bands they like in common.
Find the two most compatible people that is having maximum number of bands
12 matches
Mail list logo