recategorized by
1,763 views
1 votes
1 votes
What kind of linked list is best to answer question like “What is the item at position n?”
a) Singly linked list
b) Doubly linked list
c) Circular linked list
d) Array implementation of linked list
recategorized by

1 Answer

0 votes
0 votes
Yes for array implementation time would be order(1) but why not answer is double linked list here also to access the last element time would be order(1)  correct  if I am wrong

Related questions

0 votes
0 votes
1 answer
1
Mrityudoot asked Feb 25
144 views
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
0 votes
0 votes
1 answer
3
Vaishnavi01 asked Sep 17, 2018
635 views
struct node* foo(struct node* a, struct node* b){ struct node* result, *rec; if(a==null) return b; else if(b==null) return a; else { rec=foo(a->next,b->next...
1 votes
1 votes
0 answers
4
saipriyab asked Nov 25, 2017
1,359 views
Let P be a single linked list.Let Q be a pointer to an intermediate node 'X' in the list.What is the worst case time complexity of best known algorithm to delete the node...