Topic — Add New » Posts Last Poster Freshness
Amazon Hyderabad Online Written 2 kartik 1 week

You are given a function subtractLinkedLists which takes in 2 linked lists as it's parameters. Complete the function to return a linked list that contains the result. Negative numbers are represented by the 1st element of the linked list carrying a negative sign

Sample Testcases:

Input #00:
4->3->2->1
3->2->1

Output #00:
4->0->0->0

Input #01:
1->0->0
2->0->0

Output #01:
-1->0->0 <...

Amazon Banglore Online Written 2 kartik 1 week

Given a single linked list with an additional pointer to a random node (which can also be NULL), clone the list and return it.

Example:

One arrow points to the next element, while the other points to the 'random' element. If there is only one arrow out of a node, it points to the next node. Clone and return the head of the new list alone.

Note: Your code will not be considered for evaluation if you just return the input list as the cloned list.

linkedlist subtraction multiplication and division 1 ragini 2 weeks

i need to do subtraction multiplication and divison on linked list...can any one help me

Google Interview Question for Software Engineer/Developer (Fresher) 2 DAYADRU NAYAK 3 weeks

convert sorted doubly link list ->BST

Google
Amazon Interview Question for Software Engineer/Developer (0 - 2 Years) 4 Aashish Barnwal 3 weeks

1 > Sort the doubly linked list with out swaping the values

Amazon
Reversing doubly linked list 2 kartik 1 month

Give an algorithm to reverse a doubly linked list in less than linear time

LINK LIST 3 camster 1 month

EFFICIENT METHOD OF REVERSE A LINK LIST USING SINGLE POINTER ONLY , NO EXTRA POINTER IS USED

[closed] copy the list 3 k53 2 months

Given a doubly linked list where
1. one link points to it’s next neighbour
2. Other link points to some random node in the list(could also point to NULL)
Write an algorithm to make a copy of this list

swap node of double link list....debug help 3 mukesh kumar dhaker 2 months

could you please help me debug this code.

this is a code to swap two node of double link list.
i am not able to figure out , where i am doing wrong :( :(

here is the code:-

dll* swap_node(dll *head,dll *node1,dll *node2)
{
dll *tmp;
int flag=0;
   if(node1->prev!=NULL)
   {
       node1->prev->next=node2;
   }
   else
   {

       flag=1;
   }
   if(node1->next!=NULL)
   {
       node1->next->prev=node2;
   }

   if(node2->prev!=NULL)
   {
  ...
Amazon Interview Questions 7 Anand 2 months

A random link list is a linked list where every node contains 2 links, one like a normal node which points to the next node. The other link points to a random node in the list, even itself. You are to write a function to perform a deep copy of this random link list.

write program for following? 4 2 months

1 given a linked list 1 2 3 4 5 6 7 8 9 . if given an input 3 u hav to sort it like 7 8 9 4 5 6 1 2 3. in given 2 u hav to sort it like 8 9 6 7 4 5 2 3 1 0.

Stack using linked lists and parenthesis checking 2 kapul 3 months

please post a code for this topic

Integer sets using linked lists 1 3 months

Consider the ADT set that represents a collection of integers. The ADT should support standard set operations:

S = init();
/* Initialize S to the empty set */

isEmpty(S);
/* Return true if and only if S is the empty set */

isSingleton(S);
/* Return true if and only if S contains only one element */

isMember(S,a);
/* Return true if and only if a is a member of the set S */

S = addElement(S,a);

link list 2 kartik 3 months

Given 2 sorted linked lists - merge them. Make sure you don't have duplicates in the merged list. The input lists could have duplicates within them or across the 2 lists.

Given a Singly Linked List, swap elements in pair 16 3 months

Given a singly linked list, swap every two elements (e.g. a->b->c->d->e->f->null should become b->a->d->c->f->e->null)

deletion from circular linked list 6 3 months

You are given a circular single linked list of sufficiently many number of nodes(say more than 1 crore). You need to delete a node say P and you are given a pointer to P in the circular single list. Suggest the most efficient methodology of deleting the node P from the circular single linked list.

jony 2 3 months

Write a function which given a list that is sorted in increasing order, and a single node, inserts the node into the correct sorted position in the list.