1. Now compare implementing a Stack ADT using either an Array or a Linked List. For this question, you should consider t
Posted: Mon Jun 06, 2022 5:30 pm
1. Now compare implementing a Stack ADT using either an Array or
a Linked List. For this question, you should consider the most
efficient implementation of the Stack with each structure.
Which data structure will lead to better worst-case (Big-O)
performance for push and pop? Do not consider the
situation where the array is full.
Choice 1 of 4:An Array is better for both push and pop
Choice 2 of 4:A Linked List is better for both push and pop
Choice 3 of 4:They are the same for both push and pop
Choice 4 of 4:One is better for push, but the other is better
for pop
Compare a binary tree with a binary search tree, please select
all the true statements about their runtime efficiency using Big-O
analysis. Do not assume that either is necessarily balanced. Select
all that apply.
Choice 1 of 4:Binary trees and binary search trees have the same
worst-case runtime for find
Choice 2 of 4:Binary trees and binary search trees have the same
best case runtime for find
Choice 3 of 4:Binary trees and binary search trees have the same
worst case runtime for insert (assuming that binary tree insert
will only insert a new element as a leaf and the new node must be
inserted as a child of an existing leaf)
Choice 4 of 4:Binary trees and binary search trees have the same
best case runtime for insert (assuming that binary tree insert will
only insert a new element as a leaf and the new node must be
inserted as a child of an existing leaf)
a Linked List. For this question, you should consider the most
efficient implementation of the Stack with each structure.
Which data structure will lead to better worst-case (Big-O)
performance for push and pop? Do not consider the
situation where the array is full.
Choice 1 of 4:An Array is better for both push and pop
Choice 2 of 4:A Linked List is better for both push and pop
Choice 3 of 4:They are the same for both push and pop
Choice 4 of 4:One is better for push, but the other is better
for pop
Compare a binary tree with a binary search tree, please select
all the true statements about their runtime efficiency using Big-O
analysis. Do not assume that either is necessarily balanced. Select
all that apply.
Choice 1 of 4:Binary trees and binary search trees have the same
worst-case runtime for find
Choice 2 of 4:Binary trees and binary search trees have the same
best case runtime for find
Choice 3 of 4:Binary trees and binary search trees have the same
worst case runtime for insert (assuming that binary tree insert
will only insert a new element as a leaf and the new node must be
inserted as a child of an existing leaf)
Choice 4 of 4:Binary trees and binary search trees have the same
best case runtime for insert (assuming that binary tree insert will
only insert a new element as a leaf and the new node must be
inserted as a child of an existing leaf)