The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
Algorithm run results
1. Student Name: Arif Adatia
Course: CS261- Data Structures
Running times with other outputs for Assignment 03
LOCAL MACHINE:
NOTE: Upto n= 32000, bag using Linked listis faster and after 32,000 Dynamic Array seems to be faster. This mightbe due to the nature of memory need to maintain large Linked
Lists nodes
2.
3. FLIP results:
NOTE: Upto n= 200000, bag using Linked list isfaster and after 200,000 Dynamic Array seems to be faster. This might be due to the nature of memory need to maintainlarge Linked
Lists nodes
4.
5. QUESTIONS:
Which of the implementations is the fastest? Explain why.
Dynamic Array implementationis fastest for large n values; Linked List seems to perform better for smaller n values upto 200,000. Since
Dynamic Array is ordered and the search operationis faster.A Linked List will need more time to fetch the values since the nodes are HUGE
and memory needed is more.
Would youexpect anything to change if the loop performed remove () instead of contains ()? If so,what?
I feel the performance will remain same because both the operations do the same thing of searching the elementand then performing the
remove or contains the operation. However since remove involves compacting the memory and readjusting the elements, it will take slightly
more time than contains().
NOTE: These are purely based on my ACTUAL readings and THEORY might prophesise a different PHILOSOPLY. I feel Experimental results should provide the Theory support.
Response time for Bag using Linked LIST
FLIP: