0% found this document useful (0 votes)
67 views

Unit 1-Introduction To Data Structures and Algorithms

This unit introduces data structures and algorithms. It provides a pretest on key concepts like algorithms, data structures, pseudocode, and abstract data types. Learning activities include comparing algorithms and pseudocode, creating algorithms and pseudocode to find the largest of three numbers and convert temperatures between Fahrenheit and Celsius. The unit also defines data and data types, abstract data types, and data structures. Finally, it prompts programming the temperature conversion in AIDE, an Android app for developing code on mobile.

Uploaded by

aladdin oidacra
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Unit 1-Introduction To Data Structures and Algorithms

This unit introduces data structures and algorithms. It provides a pretest on key concepts like algorithms, data structures, pseudocode, and abstract data types. Learning activities include comparing algorithms and pseudocode, creating algorithms and pseudocode to find the largest of three numbers and convert temperatures between Fahrenheit and Celsius. The unit also defines data and data types, abstract data types, and data structures. Finally, it prompts programming the temperature conversion in AIDE, an Android app for developing code on mobile.

Uploaded by

aladdin oidacra
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Unit 1- Introduction to Data Structures and Algorithms

Pretest
Multiple Choice: Direction: Encircle the letter of the correct answer

1.___C_____is a step-by-step procedure in solving a problem.

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?

Algorithm and Pseudocode both gives informations which solves a problem.

HOW DIFFERENT?

Algorithm provides a well-defined Pseudocode


step by step procedure in solving
a problem. It is in the form of annotations and
informative text written in plain
Each instruction is clear, precise English.
and finite.
Uses short terms to write codes for
It is in a sentence form. a program.
Assessment
Activity 1. Problem Solving.

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.

Get the three numbers


If num1 is greater than num2 print num1 as the largest value.
If num2 is greater than num3 print num2 as the largest value.
If num3 is greater than num1 print num3 as the largest value.
Else print “error”
2. Create an algorithm and pseudocode in converting 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

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:

1. Explain and differentiate Data and Data Types.

Data are values or a set of values that are in a particular format.


A data refers to a single set of values, most data are categorized and are grouped.

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.

2. What is Abstract Data Type?

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.

3. Define data Structure and state its use.

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.

Application name: AIDE – IDE for Android Java C++

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:

You might also like