Yes in that case it could be definitely done in linear time. But even in case of unsorted arrays, it could be done ,one of my friend told me to use hashmap, but I have no idea how to implement though...
Type: Posts; User: malwaregeek
Yes in that case it could be definitely done in linear time. But even in case of unsorted arrays, it could be done ,one of my friend told me to use hashmap, but I have no idea how to implement though...
Yes :cool:
The question is to find the common elements in two arrays .The code which i wrote have the complexity of order n square.
void main ()
{ int i,j;
int a[]={1,2,3,4};
int b[]={4,5,7,1};
for...
Thanks. No compilation error !
Hi , there was a question asked in one of the interviews.. Delete all the nodes of link list..Let me know if I have written the correct code
struct node
{int data'
struct...