SlideShare a Scribd company logo
CS 204 – DS and Algorithms
Classroom Policy
▪ Class Time
▪ Absences
▪ Submissions
▪ Exams
What is a data?
- data is any information that can be stored,
processed, or transmitted by a computer.
- It can be numbers, text, images, or any other
form of information that can be represented
digitally.
Characteristics of data
1. Accuracy - should represent real-world values or
information correctly and precisely
2. Consistency - Data should remain uniform across
different systems or applications, avoiding
contradictions (e.g., a person’s age should match
their date of birth).
Characteristics of data
3.Timeliness - Data should be current and up-to-date to
maintain its relevance for decision-making or processing.
4. Completeness - it should contain all required information
without missing values or gaps
5. Relevance - It should be applicable and useful for its
intended purpose or context.
Characteristics of data
6. Reliability - it should come from reliable source and
dependable for accurate results
7. Validity - conform to the expected format, rules, or
ranges. Ex. E-mail should contain “@” and a domain
8. Accessibility – available and easy to retrieve or used
by authorized users or systems
Characteristics of data
9. Volatility - some data is temporary and subject to
change (volatile) while other data remain stable over
time (non-volatile)
10. Granularity - data can be detailed or summarized
based on the level of detail required.
What is an algorithm?
- An algorithm is a step-by-step process to solve a
problem, where each step indicates an
intermediate task.
- It contain finite number of steps that leads to the
solution of the problem
What are the properties/characteristics
of an algorithm?
1. Input-Output – an algorithm takes ‘0’ or more
input and produces the required output.
2. Finiteness – an algorithm must terminate in
countable number of steps
3. Definiteness – each step of an algorithm must be
stated clearly and unambiguously.
What are the properties/characteristics
of an algorithm?
4. Effectiveness – each and every step in an
algorithm can be converted into a programming
language statement.
5. Generality – algorithm is generalized one. It works
on all set of inputs and provides the required output.
(not restricted to a single input value.)
Categories of Algorithm:
▪ Sequence – performed successively one by one
without skipping any step. The sequence should be
simple and easy to understand. Each instruction of
such algorithm is executed, because no selection or
conditional branching exists.
Example of sequence statement
//adding two numbers
Step 1: start
Step 2: read a,b
Step 3: sum=a+b
Step 4: write sum
Step 5: stop
Categories of Algorithm:
▪ Selection - In order to solve the problem which
involve decision making or option selection using the
format:
if (condition)
Statement-1;
else
Statement-2;
if (condition)
Statement-1;
else
Statement-2;
**it specifies if the statement is
TRUE, statement-1 will be
executed, otherwise, statement-
2 will be executed.**
Example of selection statement
//person eligibility to vote
Step 1: start
Step 2: read age
Step 3: if age>=18 then step_4 else step_5
Step 4:write ”person is eligible to vote”
Step 5: write “person is not eligible to vote”
Step 6: stop
Example of selection statement
//biggest among two numbers
Step 1: start
Step 2: read a,b
Step 3: if a>b then
Step 4:write ”a is greater than b”
Step 5: write “b is greater than a”
Step 6: stop
Categories of Algorithm:
▪ Iteration - type of algorithm that is used in solving
problems in which involves repetition of statement.
A particular number of statements are repeated n
number of times.
How to write an algorithm?
▪ There are no well-defined standards for writing
algorithms
▪ It is problem and resource dependent.
▪ Never written to support a particular programming
code
▪ Know the problem domain for which you are
designing a solution.
Why analysis of algorithm?
▪ Algorithm analysis helps us to determine which
algorithm is most efficient in terms of time and space
consumed.
▪ The goal of the analysis of algorithms is to compare
algorithms (or solutions) mainly in terms of running
time but also in terms of other factors (e.g., memory,
developer effort, etc.)
What is Running Time Analysis?
▪ It is the process of determining how processing time
increases as the size of the problem (input size)
increases.
▪ Input size is the number of elements in the input, and
depending on the problem type, the input may be of
different types.
The following are the common types of
inputs.
▪ Size of an array
▪ Polynomial degree
▪ Number of elements in a matrix
▪ Number of bits in the binary representation of the input
▪ Vertices and edges in a graph
How to compare algorithms?
▪ Computing the running time
Affected by:
1. input size
2. machine type
3. programming style
What is a program
▪ a program is a specific set of ordered operations
for a computer to perform.
▪ In the modern computer that John von
Neumann outlined in 1945, the program contains a
one-at-a-time sequence of instructions that the
computer follows.
Characteristics of a program
1. Flexibility- should be written in such a manner that it
allows one to add new features without changing the
existing module
2. User-friendly - it's a technical solution that is easy for all
(or at least most) people to use to get their jobs done.
3. Portability - it can be used in an operating systems other
than the one in which it was created without requiring
major rework.
Characteristics of a program
4. Reliability - the probability of failure-free operation of a
computer program for a specified period in a specified
environment. Reliability is a customer-oriented view of software
quality.
5. Self-documenting code - code that doesn't require
code comments for human to understand its naming conventions
and what it is doing. It utilizes descriptive method and variable
names that resemble human speech.
Data Structure
- A data structure is a special format for storing and
organizing data.
- General data structure types include arrays, files, linked
lists, stacks, queues, graphs and so on.
Characteristics of Data Structure
1. Correctness - should accurately implement its interface
2. Time Complexity - The running time or execution time of
data structure operations must be as short as feasible.
▪ Best Case
▪ Worst Case
Data Structure
3. Space Complexity - refers to the total amount of memory
space used by an algorithm/program, including the space of
input values for execution. Calculate the space occupied by
variables in an algorithm/program to determine space
complexity. The best algorithm/program should have a low
level of space complexity
Assignment#3
Make a simplest algorithm for the following and be
able to explain it in class.
1. Create an algorithm that will generate the first 10
even numbers and display the sum of it.
2. Create an algorithm that will input two numbers and
display the sum, difference, product and quotient.
3. Create an algorithm that will determine if the number
is divisible by 2, it will display a message “divisible by
2”, otherwise, “not divisible by 2” will be displayed.

More Related Content

PPTX
Design and Analysis of Algorithm ppt for unit one
PPTX
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
PPTX
Modile-1-PPT-1-BCAC0207-AlgorithmDesign.pptx
PPTX
Unit 1, ADA.pptx
PPTX
Chapter 09 design and analysis of algorithms
PPT
Lec1.ppt
PPTX
Algorithm in data structure bca .pptx
PDF
Algorithms.pdf
Design and Analysis of Algorithm ppt for unit one
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
Modile-1-PPT-1-BCAC0207-AlgorithmDesign.pptx
Unit 1, ADA.pptx
Chapter 09 design and analysis of algorithms
Lec1.ppt
Algorithm in data structure bca .pptx
Algorithms.pdf

Similar to lecture on preliminary on data structore (20)

PPT
UNIT-1-PPTS-DAA INTRO WITH DIVIDE AND CONQUER
PPT
UNIT 1- Design Analysis of algorithms and its working
PPT
UNIT-1-PPTS-DAA_INTRODUCTION_TO_DAA_GH.ppt
PPTX
Chapter 1 Data structure.pptx
PPT
UNIT-1-PPT-DESIGN AND ANALYSIS OF ALGORITHMS
DOCX
Data Abstraction (Chapter 1)
PDF
Lecture 2 role of algorithms in computing
PPT
UNIT-1-PPTS-DAA.ppt
PPT
UNIT-1-PPTS-DAA.ppt
PPT
Introduction to Design Algorithm And Analysis.ppt
PPTX
Introduction to databae eChapter 1-.pptx
PPTX
Intro to Data Structure & Algorithms
PDF
Data structure and algorithm Chapter_1.pdf
PPTX
problem solving and algorithm development
PDF
lect 1-ds algo(final)_2.pdf
PDF
UNIT-1-PdjfjfjfjfjfjfjfjfjfjfjPTS-DAA.pdf
PDF
UNIT-1-PPTS-DAA_cofjfjvjcjcncnfncmpressed.pdf
PPTX
Chapter 1- IT.pptx
PPTX
Algorithmics, intro to data structures.pptx
PPTX
Design and Analysis of Algorithms.pptx
UNIT-1-PPTS-DAA INTRO WITH DIVIDE AND CONQUER
UNIT 1- Design Analysis of algorithms and its working
UNIT-1-PPTS-DAA_INTRODUCTION_TO_DAA_GH.ppt
Chapter 1 Data structure.pptx
UNIT-1-PPT-DESIGN AND ANALYSIS OF ALGORITHMS
Data Abstraction (Chapter 1)
Lecture 2 role of algorithms in computing
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
Introduction to Design Algorithm And Analysis.ppt
Introduction to databae eChapter 1-.pptx
Intro to Data Structure & Algorithms
Data structure and algorithm Chapter_1.pdf
problem solving and algorithm development
lect 1-ds algo(final)_2.pdf
UNIT-1-PdjfjfjfjfjfjfjfjfjfjfjPTS-DAA.pdf
UNIT-1-PPTS-DAA_cofjfjvjcjcncnfncmpressed.pdf
Chapter 1- IT.pptx
Algorithmics, intro to data structures.pptx
Design and Analysis of Algorithms.pptx
Ad

Recently uploaded (20)

PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Lesson notes of climatology university.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
master seminar digital applications in india
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Pharma ospi slides which help in ospi learning
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Supply Chain Operations Speaking Notes -ICLT Program
Lesson notes of climatology university.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
A systematic review of self-coping strategies used by university students to ...
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial diseases, their pathogenesis and prophylaxis
master seminar digital applications in india
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
VCE English Exam - Section C Student Revision Booklet
Pharmacology of Heart Failure /Pharmacotherapy of CHF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
human mycosis Human fungal infections are called human mycosis..pptx
Pharma ospi slides which help in ospi learning
Ad

lecture on preliminary on data structore

  • 1. CS 204 – DS and Algorithms Classroom Policy ▪ Class Time ▪ Absences ▪ Submissions ▪ Exams
  • 2. What is a data? - data is any information that can be stored, processed, or transmitted by a computer. - It can be numbers, text, images, or any other form of information that can be represented digitally.
  • 3. Characteristics of data 1. Accuracy - should represent real-world values or information correctly and precisely 2. Consistency - Data should remain uniform across different systems or applications, avoiding contradictions (e.g., a person’s age should match their date of birth).
  • 4. Characteristics of data 3.Timeliness - Data should be current and up-to-date to maintain its relevance for decision-making or processing. 4. Completeness - it should contain all required information without missing values or gaps 5. Relevance - It should be applicable and useful for its intended purpose or context.
  • 5. Characteristics of data 6. Reliability - it should come from reliable source and dependable for accurate results 7. Validity - conform to the expected format, rules, or ranges. Ex. E-mail should contain “@” and a domain 8. Accessibility – available and easy to retrieve or used by authorized users or systems
  • 6. Characteristics of data 9. Volatility - some data is temporary and subject to change (volatile) while other data remain stable over time (non-volatile) 10. Granularity - data can be detailed or summarized based on the level of detail required.
  • 7. What is an algorithm? - An algorithm is a step-by-step process to solve a problem, where each step indicates an intermediate task. - It contain finite number of steps that leads to the solution of the problem
  • 8. What are the properties/characteristics of an algorithm? 1. Input-Output – an algorithm takes ‘0’ or more input and produces the required output. 2. Finiteness – an algorithm must terminate in countable number of steps 3. Definiteness – each step of an algorithm must be stated clearly and unambiguously.
  • 9. What are the properties/characteristics of an algorithm? 4. Effectiveness – each and every step in an algorithm can be converted into a programming language statement. 5. Generality – algorithm is generalized one. It works on all set of inputs and provides the required output. (not restricted to a single input value.)
  • 10. Categories of Algorithm: ▪ Sequence – performed successively one by one without skipping any step. The sequence should be simple and easy to understand. Each instruction of such algorithm is executed, because no selection or conditional branching exists.
  • 11. Example of sequence statement //adding two numbers Step 1: start Step 2: read a,b Step 3: sum=a+b Step 4: write sum Step 5: stop
  • 12. Categories of Algorithm: ▪ Selection - In order to solve the problem which involve decision making or option selection using the format: if (condition) Statement-1; else Statement-2;
  • 13. if (condition) Statement-1; else Statement-2; **it specifies if the statement is TRUE, statement-1 will be executed, otherwise, statement- 2 will be executed.**
  • 14. Example of selection statement //person eligibility to vote Step 1: start Step 2: read age Step 3: if age>=18 then step_4 else step_5 Step 4:write ”person is eligible to vote” Step 5: write “person is not eligible to vote” Step 6: stop
  • 15. Example of selection statement //biggest among two numbers Step 1: start Step 2: read a,b Step 3: if a>b then Step 4:write ”a is greater than b” Step 5: write “b is greater than a” Step 6: stop
  • 16. Categories of Algorithm: ▪ Iteration - type of algorithm that is used in solving problems in which involves repetition of statement. A particular number of statements are repeated n number of times.
  • 17. How to write an algorithm? ▪ There are no well-defined standards for writing algorithms ▪ It is problem and resource dependent. ▪ Never written to support a particular programming code ▪ Know the problem domain for which you are designing a solution.
  • 18. Why analysis of algorithm? ▪ Algorithm analysis helps us to determine which algorithm is most efficient in terms of time and space consumed. ▪ The goal of the analysis of algorithms is to compare algorithms (or solutions) mainly in terms of running time but also in terms of other factors (e.g., memory, developer effort, etc.)
  • 19. What is Running Time Analysis? ▪ It is the process of determining how processing time increases as the size of the problem (input size) increases. ▪ Input size is the number of elements in the input, and depending on the problem type, the input may be of different types.
  • 20. The following are the common types of inputs. ▪ Size of an array ▪ Polynomial degree ▪ Number of elements in a matrix ▪ Number of bits in the binary representation of the input ▪ Vertices and edges in a graph
  • 21. How to compare algorithms? ▪ Computing the running time Affected by: 1. input size 2. machine type 3. programming style
  • 22. What is a program ▪ a program is a specific set of ordered operations for a computer to perform. ▪ In the modern computer that John von Neumann outlined in 1945, the program contains a one-at-a-time sequence of instructions that the computer follows.
  • 23. Characteristics of a program 1. Flexibility- should be written in such a manner that it allows one to add new features without changing the existing module 2. User-friendly - it's a technical solution that is easy for all (or at least most) people to use to get their jobs done. 3. Portability - it can be used in an operating systems other than the one in which it was created without requiring major rework.
  • 24. Characteristics of a program 4. Reliability - the probability of failure-free operation of a computer program for a specified period in a specified environment. Reliability is a customer-oriented view of software quality. 5. Self-documenting code - code that doesn't require code comments for human to understand its naming conventions and what it is doing. It utilizes descriptive method and variable names that resemble human speech.
  • 25. Data Structure - A data structure is a special format for storing and organizing data. - General data structure types include arrays, files, linked lists, stacks, queues, graphs and so on. Characteristics of Data Structure 1. Correctness - should accurately implement its interface 2. Time Complexity - The running time or execution time of data structure operations must be as short as feasible. ▪ Best Case ▪ Worst Case
  • 26. Data Structure 3. Space Complexity - refers to the total amount of memory space used by an algorithm/program, including the space of input values for execution. Calculate the space occupied by variables in an algorithm/program to determine space complexity. The best algorithm/program should have a low level of space complexity
  • 27. Assignment#3 Make a simplest algorithm for the following and be able to explain it in class. 1. Create an algorithm that will generate the first 10 even numbers and display the sum of it. 2. Create an algorithm that will input two numbers and display the sum, difference, product and quotient. 3. Create an algorithm that will determine if the number is divisible by 2, it will display a message “divisible by 2”, otherwise, “not divisible by 2” will be displayed.