Unit 1-Introduction To Data Structures and Algorithms
Unit 1-Introduction To Data Structures and Algorithms
Pretest
Multiple Choice: Direction: Encircle the letter of the correct answer
a. Software
b. Computer
c. Algorithm
d. Computer Procedure
2.___B____ refers to the data that a variable can hold in programming language?
a. Structure
b. Data Structures
c. Data Types
d. Data
3. ___D___ is an artificial language used to describe computer program without using
the syntax of any particular programming language.
a. Algorithm
b. Programming Languages
c. Machine language
d. Pseudocode
4.____A____are specialized format for storing and organizing data in a computers
memory or disk.
a. Data Structures
b. Data
c. Pseudocode
d. Algorithms
5. ____B____ refers to a specification of a set of data and set of operations performed
in a data.
a. Information
b. Abstract Data Types
c. Data
d. Data Structure
Learning Activities
Activity 1: Compare / Contrast Diagram Compare or contrast the two items in the box
below. Write the comparison below the “HOW ALIKE?” box and write its
differentiation below the “HOW DIFFERENT?” box.
ALGORITHM PSEUDOCODE
HOW ALIKE?
HOW DIFFERENT?
1. Create an algorithm and pseudocode to find the largest value of any three numbers.
Algorithm:
1. Start
2. First let the users input values to the variables num1, num2, and num3.
3. To find the largest value, if num1 is greater than num2 then display num1 as
the largest value. If false proceed.
4. If num2 is greater than num3 then display num2 as the largest value. If false
proceed.
5. If num3 is greater than num1 then display num3 as the largest value. If false
proceed.
6. Else, display error.
7. End.
Pseudocode:
This program will determine the largest value of any three numbers entered by the user.
Algorithm:
1. Start
2. Display “Fahrenheit to Celsius”
3. Then let the user input value to the variable F (for ˚F) and make variable C
(for ˚C).
4. Next, consider 17.77777777777778 ˚F is equal to 1˚C
5. And then display variable C.
6. end
Activity 2.
ESSAY: Answer the following questions:
While data types refers to a data that a variable can hold in programming language.
Data types are used by the programmers for referencing to ensure that the program
comes up with the proper result and is error-free.
Abstract Data Type is a special kind of datatype, whose behavior is defined by a set
of values and set of operations. Abstract Data Type is composed of two parts, the
declaration of data and the declaration of operations.
Data Structure is a way to store and organize data in a computer’s memory so that
these data can be used later on.
Activity 3. Programming
In creating programs in this course, we can utilize compiler application that can be
downloaded and installed on smart phone. If you have laptops or personal computers
at home you can also download any compiler to write and run your code.
For those who have smart phone you can install this application for you to write and
run a code.
1. Now create a program that will convert temperature from Fahrenheit to Celsius.
Temperature in Fahrenheit is the input and temperature in Celsius is the output. Use
this formula: ˚C = (˚F – 32 ) x 5 / 9. Screenshot your code and the output and submit it
in our google classroom. Using this classroom code: e6u3rbj.
Write your thoughts about the unit here: