Question

Array list, linked list, Stack, Queue, Binary tree, Hash table. In which cases do they apply...

Array list, linked list, Stack, Queue, Binary tree, Hash table.

In which cases do they apply to (combined with time complexity analysis)

please answer the question completely note: which cases do they apply to (combined with time complexity analysis)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:
Array List
- It's been used in the scenarios where size of the data structure is not known in advance, and we need random access of the data.
For Accessing any particular index - O(1)
For Searching element - O(n)

Linked List - Its used in the scenario where space utilization is must, and random access of variable is not required.
For Accessing any particular index - O(n)
For Searching element - O(n)
For accessing first element - O(1)

Stack - Used in the scenario where Last In First Out (LIFO) case arises. An example being stacking the plate, after that they are accessible in LIFO.
For Accessing any particular index - O(n)
For Searching element - O(n)
For Accessing top element - O(1)

Queue : Used in the scenario where FirstIn First Out (FIFO) case arises. An example being OS process scheduling algorithm which can follow First come firs serve approach
For Accessing any particular index - O(n)
For Searching element - O(n)
For Accessing last element - O(1)

Binary Search Tree : Its been used in the cases where searching is needed but modification of the data also happend quite often.
For Accessing any particular index - O(log(n))
For Searching element - O(log(n))
For Adding an element - O(log(n))

Hash Table : Its used in the cases where searching is the most prominent task and modification of data happen very less. Example could be various static lookup table which most of the program uses.
For Searching element - O(1)
For Adding an element - O(n)

(plz give me a thums up...if my answer helped you and if any suggestion plz comment, Yr thums up boost me)

Add a comment
Know the answer?
Add Answer to:
Array list, linked list, Stack, Queue, Binary tree, Hash table. In which cases do they apply...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT