Search Header Logo
DCS2101 - Week 11 (Practical Applications)

DCS2101 - Week 11 (Practical Applications)

Assessment

Presentation

Computers

University

Practice Problem

Easy

Created by

Yasmin Basiran

Used 1+ times

FREE Resource

25 Slides • 12 Questions

1

media

2

media

3

media

4

media

5

Open Ended

Imagine you’re stacking bottles. You can only grab or place bottles from the top
What real-world data structure do you think your bottle stack behaves like?

6

media

7

media

8

media

9

media

10

media

11

media

12

media

13

media

14

media

15

Multiple Choice

What is encapsulation in object-oriented programming?

1
Encapsulation is the bundling of data and methods that operate on that data within a single unit, restricting access to some components.
2
Encapsulation refers to the process of inheriting properties from another class.
3
Encapsulation is the separation of data and methods into different classes.
4
Encapsulation is the practice of exposing all data and methods to the public.

16

Multiple Choice

What is an accessor function?

1
An accessor function is a type of data structure.
2
An accessor function modifies an object's property value.
3
An accessor function is a method that retrieves the value of an object's property.
4
An accessor function is a method that deletes an object's property.

17

Multiple Choice

Which keyword ensures that a member function cannot modify any data members of the class?

1
override
2
const
3
virtual
4
static

18

Multiple Choice

What is the main benefit of using accessor and mutator functions?

1
They promote data encapsulation and integrity by controlling access to an object's properties.
2
They simplify code by removing the need for direct property access.
3
They allow for multiple inheritance in object-oriented programming.
4
They enhance performance by reducing the number of function calls.

19

media

20

media

21

media

22

media

23

media

24

media

25

media

26

media

27

media

28

29

Multiple Choice

What is postfix notation also called?

1
Infix Notation
2
Postfix Arithmetic
3
Reverse Polish Notation (RPN)
4
Standard Polish Notation

30

Multiple Choice

What is the postfix form of (A + B) * C?

1
C A B + *
2
B A * C +
3
A B + C *
4
A C * B +

31

Multiple Choice

Which algorithm is used to convert infix to postfix?

1
A* search algorithm
2
Depth-first search algorithm
3
Dijkstra's algorithm
4
Shunting Yard algorithm

32

Reorder

Reorder the following equation to become a postfix expression

(7+3) * 8

7

3

+

8

*

1
2
3
4
5

33

Multiple Choice

What is the main benefit of postfix expressions?

1
Elimination of parentheses and easier evaluation.
2
Reduction of computational efficiency and speed.
3
More reliance on operator precedence rules.
4
Increased complexity and slower evaluation.

34

Draw

Draw the stack contents step-by-step for evaluating 4 5 + 2 * 7 -.

35

Draw

Convert the infix expression (3 + 2) * (5 - 1) into postfix form, showing all steps.

36

media

37

media
media

Show answer

Auto Play

Slide 1 / 37

SLIDE