wayground logo

Lembar Kerja Gratis yang Dapat Dicetak

BARU

Ukuran huruf

S
M
L
XL
Lembar kerja

Abstract Data Types

Total soal: 20

Worksheet time: 19mins

Nama
Kelas
Tanggal
1.

_________________ is a collection of elements used to store the same type of data.

a)

Array

b)

Function

c)

Case

d)

Loop

2.
Storage for data defined in terms of set of operations to be performed on the data 
a)
Arrays
b)
Variables
c)
Abstract Data Types
d)
Algorithms
3.

Act of adding values into a stack is called

a)

Pop

b)

Poll

c)

Push

d)

Insert

4.

If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

5.

Consider the following operation performed on a stack of size 5.


Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);


After the completion of all operation, get the total number of element present in stack is

a)

1

b)

2

c)

3

d)

4

6.

Only the top element can be accessed in stack

a)

TRUE

b)

FALSE

7.

Which of them is an abstract data structure (ADT)?

a)

Stacks

b)

Functions

c)

Queues

d)

Both A and C

8.

Which of the following uses the FIFO method

a)

Queue

b)

stack

c)

linked list

d)

none of the above

9.

Which function is called in a POP() function

a)

IsEmpty()

b)

IsFull()

10.

Consider Stack is implemented using the array.

#define MAX 10

struct STACK

{

int arr[MAX]

int top = ___________;

}

What will be the initial value with which top is initialized.

a)

0

b)

-1

c)

10

d)

1

11.

Consider the following operations performed on a stack of size 5:

Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e)

Which of the following statements is correct?

a)

Underflow occurs

b)

Stack operations are performed smoothly

c)

Overflow occurs

d)

None of the above

12.

Consider the following sequence of operations performed on a stack:

push (1), push (2), pop, push (1), push (2), pop, pop, pop, push (2), pop.

What is the sequence of popped out values?

a)

2,2,1,1,2

b)

2,2,1,2,2

c)

2,1,2,2,1

d)

2,1,2,2,2

13.

In a stack, if a user tries to remove an element from an empty stack it is called _________

a)

Underflow

b)

Empty collection

c)

Overflow

d)

An error

14.

The process of removing an element from a stack is called ____________

a)

Delete

b)

Push

c)

Insert

d)

Pop

15.

User perform following operations on stack of size 5 then -

push(1);

pop();

push(2);

push(3);

pop();

push(2);

pop();

pop();

push(4);

pop();

pop();

push(5);

a)

Overflow Occurs

b)

Stack Operations will be performed Smoothly

c)

Underflow Occurs

d)

None of these

16.

List of data in which element can be inserted and removed at the same end is called a/an __________.

a)

array

b)

stack

c)

linked list

d)

queue

17.

If the user push 1 element in the stack already containing five elements and having stack size as 5 then the stack becomes an ___________.

a)

Overflow

b)

User Flow

c)

Underflow

d)

Error

18.

Consider above is a Stack implemented using the array.

In this implementation of stack maximum value of top which cannot cause overflow will _________.

a)

11

b)

10

c)

9

d)

None of the answer

19.
The elements are removal from a stack in .......... order.
a)
Reverse
b)
Hierarchical
c)
Alternative
d)
 Sequential
20.

An array is said to permit random access of values stored in that data structure. Implementing stacks using arrays means that any item stored in the stack can be accessed randomly.

a)

True

b)

False