Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C program This is a review for an upcoming exam! 1. T / F One benefit of arrays

ID: 3852147 • Letter: C

Question

C program

This is a review for an upcoming exam!

1. T     /      F   One benefit of arrays over linked list ADTs is that inserting and deleting items is much quicker O( 1 ) with an array vs. the linked list notation of O ( n ).

2. T     /      F   There is no restriction on the size of a linked list.

3. T     /      F Stacks and Queues are not considered an ADT linear data structure

           

4. T     /      F It is easy to tell if an ADT is a stack, queue or linear linked list by looking at the structure of it.

5. The two stack operations are ________________ (putting items on the stack) and _______________ (when you take items off the stack).

6. The two queue operations are _______________ (putting items in the queue) and ________________ (when you remove items from the queue).

7. LIFO is used to describe _________________ operations.

8. FIFO is used to describe _________________ operations.

9. “Bag” ADT operations include
            a) check for a full bag
            b) check for duplicates in the bag
            c) intersection
            d) none of the above

10. Bank teller waiting lines, ticket windows in ski areas, entrances from rides at an amusement park would all be examples of a _______________________ .

Explanation / Answer

1. True.

The reason is for linked list, you have to traverse the list to do middle insertions, so that becomes O(n) and you are also not required to shift the elements downwards though.

2. True.

The reason is that the linked list doesn't use an array as an underlying storage, so that helps in not limiting the size but it will report the size invalid message if the size grows bigger than the Integer.MaxValue() because it uses int to store the size and the return type of the size is also int.

3. False.

The reason is that both the stack and queue are abstract datatype and linear data structures.

4.True.

The stacks , queues and linear linked list have a total different structures and it will be easily identifiable because the structure of each and every ADT is different from each other.

5. push , pop

When the items are inserted into the stack we use push operation and when the items are deleted from the stack we use pop operation.

6. enqueue , dequeue

When the items are inserted into the queue we use enqueue operation and when the items are deleted from the queue we use dequeue operation.

7. Stack

The LIFO is used to describe the stack operations because in the stack the first in reaches the top of the stack.

8.Queue

The FIFO is used to describe all of the queue operations in the queue.

9. d.) None of the above.

The operations that are included in the BAG are as follows:

10.) Queue Management

This is because all the waiting processes are been described in the question which requires a queue of the people and hence, the queue management is a perfect answer.

Please rate the answer if it helped.....Thankyou

Hope it helps.....