Download presentation
Presentation is loading. Please wait.
1
CS212 Data Structures 2018 Second Semester
2
Welcome to Data Structures Course & Wish you a Happy semester
3
Percentage from overall grade
Grading Assessment method Assessment Week Grade Percentage from overall grade Quiz1 Week 6 2.5 2.5% Quiz2 Week 10 Lab Work& Assignment Weekly 5 5% Final Practical Exam Week 13 20 20% Blog Name:
4
What is Data Structures?
In Java we learned how to program correctly (following user requirements) and coding with no errors Now, we need to be more professional programmers and not focus only on the correctness of the program, but on its “Efficiency” Efficiency will be concerned if the program is complex (huge data and users requests) For example, Google search is one the complex programs which need to be maintained in terms of its efficiency.
5
What is Data Structures?
Program’s efficiency can be reached by structuring out the huge amount of data stored on it, and organize it in someway which makes it easy for the program to access it and thus it be more efficient. (i.e. organizing lots of papers in real life makes it easy for use to reach specific paper) Data structures have many formats; each one can be used for a specific program’s purpose. Examples: Array (classes’ grades), Queue (requests of a restaurant), Stack (undo in Microsoft word), etc.
6
Algorithms In order to make an efficient program we need to use data structure as well as writing an efficient algorithm i.e. 2 programmers may write same method doing the same purpose, but one may write it in a complex way (many for loops) and the other write it in “smart” way (single for loop). O( ) is a method efficiency measurement
7
Revision on Java Before diving into the data structures, let us review the Java language and write some code to refresh out ourselves
8
Lab 1 Revision Questions
Q1: Write a Java program to print a triangle shape of stars. Sample output:
9
Lab 1 Revision Questions
Q2: Write a Java program to compute the average of three numbers. The numbers should be enter by the user. Sample output:
10
Lab 1 Revision Questions
Q3: Write a program, which reads Letters from the user , store them in an array ,and outputs how many times a particular letter appears in the array. Your program must: Read from the user the size of the array Get the letters from the user and store them in the array. Create CountLetters Method which gets an array as a parameter and counts how many times the letter appears. Your method should ask the user to enter a letter and it will print how many times this letter appears in an array.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.