wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Employability Skills-II

Total questions: 30

Worksheet time: 17mins

Name
Class
Date
1.

What is a stack in data structure?

a)

A stack is a linear data structure that follows the Last In, First Out (LIFO) principle.

b)

A stack is a non-linear data structure.

c)

A stack is a data structure that allows random access to elements.

d)

A stack is a data structure that follows the First In, First Out (FIFO) principle.

2.

Explain the concept of LIFO in the context of stacks.

a)

LIFO in stacks means Last In, Last Out.

b)

LIFO in stacks means Last In, First Out.

c)

FIFO in stacks means First In, First Out.

d)

LIFO in stacks means First In, Last Out.

3.

What are the two primary operations that can be performed on a stack?

a)

insert and delete

b)

push and pop

c)

add and remove

d)

push and peek

4.

What does the push operation do in a stack?

a)

Reverses the order of elements in the stack.

b)

Multiplies two elements in the stack.

c)

Removes an element from the bottom of the stack.

d)

Adds a new element to the top of the stack.

5.

Explain the pop operation in a stack.

a)

The pop operation in a stack removes the top element from the stack.

b)

The pop operation in a stack rearranges the elements in the stack.

c)

The pop operation in a stack removes the bottom element from the stack.

d)

The pop operation in a stack adds an element to the top of the stack.

6.

How is the top element of a stack accessed?

a)

By using the remove() method

b)

By using the peek() method

c)

By pushing a new element

d)

By popping the element

7.

What happens when you try to pop from an empty stack?

a)

An error indicating the stack is empty

b)

The stack grows infinitely

c)

The popped element is set to null

d)

The stack is automatically resized

8.

Can a stack be implemented using arrays? If yes, how?

a)

Yes, a stack can be implemented using arrays.

b)

No, a stack cannot be implemented using arrays.

c)

Yes, a stack can be implemented using trees.

d)

Yes, a stack can only be implemented using linked lists.

9.

Discuss the importance of stacks in computer science.

a)

Stacks are crucial in computer science due to their LIFO nature, aiding in various applications like function calls, expression evaluation, backtracking, and undo functionalities.

b)

Stacks are rarely used in computer science

c)

Stacks are primarily used for sorting algorithms in computer science

d)

Stacks are only applicable in specific niche areas of computer science

10.

Give an example of a real-life scenario where a stack data structure can be used.

a)

Organizing a to-do list

b)

Managing browser history

c)

Tracking inventory in a warehouse

d)

Storing user login information

11.

A Queue is a Non - linear structure .

a)

True

b)

False

12.

In ____ structure the First In First Out order is followed.

a)

Stack

b)

Queue

c)

Linked List

d)

Graph

13.

In queue addition will take place in the ____

a)

Top

b)

Front

c)

Rear

d)

None

14.

•The process to add an element into queue is called ____

a)

Enqueue

b)

Dequeue

c)

Listing

d)

None

15.

______ is also called Ring Buffer

a)

Queue

b)

Stack

c)

Array

d)

Circular Queue

16.

What is the time complexity to access an element in an

array using an index?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n log n)

17.

Which of the following correctly describes the way arrays

are stored in memory?

a)

Randomly

b)

Contiguously

c)

Non-contiguously

d)

None of the above

18.

Given an array int arr[5] = {1, 2, 3, 4, 5};, what will be the

value of arr[2]?

a)

1

b)

2

c)

3

d)

4

19.

What is the main advantage of a linked list over an array?

a)

Fixed size

b)

Easier access to elements using an index

c)

Dynamic size

d)

Faster access to elements

20.

Which of the following is not a type of linked list?

a)

Singly linked list

b)

Doubly linked list

c)

Circular linked list

d)

Triply linked list

21.

What does each node in a singly linked list contain?

a)

Data only

b)

Data and a reference to the next node

c)

Data and references to both the next and previous nodes

d)

Data and a reference to the previous node

22.

In a circular linked list, the last node points to:

a)

The first node

b)

The middle node

c)

A null value

d)

The previous node

23.

Which of the following statements is true about a doubly

linked list?

a)

Each node has only one link field.

b)

The list can only be traversed in one direction.

c)

Each node contains a link to the previous node and the next node.

d)

The last node points to the head node.

24.

In ____________ data structure, the data items are arranged in a linear sequence.

a)

linear

b)

non linear

c)

both a and b

d)

all of above

25.

In ___________ data structure data items are not in sequence.

a)

non linear

b)

linear

c)

non-homogeneous

d)

all of above

26.

____________data structures are those whose sizes and structures associated memory locations are fixed at compile time.

a)

linear

b)

homogeneous

c)

static

d)

dynamic

27.

Every stack has a variable _________ associated with it.

a)

TOP

b)

BOT

c)

POT

d)

none of the above

28.

_________ operation adds an element to the top of the stack.

a)

pop

b)

push

c)

peep

d)

all of the above

29.

A function calls itself is called ___________.

a)

queue

b)

recursion

c)

function

d)

none of above

30.

A queue is a _________ data structure in which each element that was inserted first is the first one to be taken out.

a)

FITO

b)

FIFO

c)

FISO

d)

FIVO