4,255 views
1 1 vote
Given two unsorted singly-linked lists each with n distinct elements. There exists an efficient intersection algorithm, that computes and returns a new list with common elements between the input lists. How much time does the intersection algorithm requires in worst case, if it is allowed to use constant extra space only?

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
1 1 answer
1.3k
1.3k views
Ahsanul Hoque asked Mar 6, 2018
1,322 views
Can anyone check this program?I got some warning.#include<stdio.h>#include<stdlib.h>void func(struct node *); struct node{ int data; struct node *next;}; int ...
0 0 votes
1 1 answer
2.4k
2.4k views
gagan55 asked Jul 13, 2023
2,445 views
How to Visualize this code ?#include<stdio.h #include<stdlib.h struct node{ int data; struct node *next; }; void addFirst(struct node head,int val){ struct node *newNode...
0 0 votes
0 0 answers
953
953 views
Lakshman Bhaiya asked Oct 26, 2018
953 views
Consider the following function:Find(Element Type X,List L) { Position Prev_Pos,XPos; Prev_Pos=Find Previous(X,L); if(Prev_Pos ->Next!=NULL) /* found */ ...
1 1 vote
1 answers 1 answer
23.8k
23.8k views
arya_stark asked Jul 4, 2018
23,822 views
What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?(a) O(1) (b...