The Gateway to Computer Science Excellence
+1 vote
768 views

The efficient data structure to insert/delete a number in a stored set of number is

  1. Queue
  2. Linked list
  3. Doubly linked list
  4. Binary tree
in Others by Veteran (105k points)
retagged by | 768 views

2 Answers

+1 vote
clearly doubly linked list  C) as it can do it fastest than rest
by Boss (49.3k points)
0 votes
I think Doubly linked list

Reason:

only the node to be inserted/deleted needs to be manipulated and no traversals in forward or backward direction required for the operation so it is more efficient. :)
by Boss (33k points)
0
only the node to be inserted/deleted needs to be manipulated and no traversals in forward or backward direction required for the operation.

According to you ... DLL takes O(1) time right ??

consider a sorted array A[] = { 1, 3, 5, 7, 9, 10, 20}.

And we want to insert 6 or we want to delete 9 from the sorted list ... 

How much time it will take by double LL ..  ??

And if option D had been Binary Search tree instead of binary tree then ??

Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,370 answers
198,506 comments
105,274 users