1.01.Introduction.pptx

Binish Raza
Binish RazaAssistant Professor at Pakistan Institute of Engineering and Technology, Multan en Pakistan Institute of Engineering and Technolohy, Multan
ECE 250 Algorithms and Data Structures
Douglas Wilhelm Harder, M.Math. LEL
Department of Electrical and Computer Engineering
University of Waterloo
Waterloo, Ontario, Canada
ece.uwaterloo.ca
dwharder@gmail.com
© 2006-2018 by Douglas Wilhelm Harder. Some rights reserved.
Welcome to ECE 250
Algorithms and Data Structures
2
Introduction
Support WEEF
Remember that WEEF is one of the few organizations which will
support you throughout your undergraduate career
http://www.weef.uwaterloo.ca/
3
Introduction
ECE 150 Fundamentals of Programming
ECE 150 covered:
– The history of computing / objects / types / console I/O
– Operators / loops / methods / parameter passing
– Selection statements / arrays / strings
– Exceptions / debugging
– File input / file output
– Pointers / unsafe code / linked lists
– Collections / multi-dimensional arrays / search algorithms
– Sorting algorithms
– Object-oriented design / polymorphism / interfaces / inheritance
– Abstract class
4
Introduction
ECE 150 Fundamentals of Programming
These were the basics of programming
– The ability to manipulate the computer to perform the required tasks
You saw data storage techniques:
– Arrays, and
– Linked lists (collections were discussed)
You saw array accessing/manipulation techniques:
– Searching, and
– Sorting
5
Introduction
ECE 250 Algorithms and Data Structures
In this course, we will look at:
– Algorithms for solving problems efficiently
– Data structures for efficiently storing, accessing, and modifying data
We will see that all data structures have trade-offs
– There is no ultimate data structure...
– The choice depends on our requirements
6
Introduction
ECE 250 Algorithms and Data Structures
‫‫‬ Consider accessing the kth entry in an array or linked list
– In an array, we can access it using an index array[k]
• You will see in ECE 222 that there is a single machine instruction for this
– We must step through the first k – 1 nodes in a linked list
‫‫‬ Consider searching for an entry in a sorted array or linked list
– In a sorted array, we use a fast binary search
• Very fast
– We‫‫‬must‫‫‬step‫‫‬through‫‫‬all‫‫‬entries‫‫‬less‫‫‬than‫‫‬the‫‫‬entry‫‫‬we’re‫‫‬looking‫‫‬for
• Slow
7
Introduction
ECE 250 Algorithms and Data Structures
‫‫‬ However, consider inserting a new entry to the start of an array or a
linked list
– An array requires that you copy all the elements in the array over
• Slow for large arrays
– A linked list allows you to make the insertion very quickly
• Very fast regardless of size
8
Introduction
ECE 250 Algorithms and Data Structures
‫‫‬ All course-related material on the course web site
http://ece.uwaterloo.ca/~dwharder/aads/
‫‫‬ This includes:
– The Course Outline
– Various tutorials
– Lecture Material
– Lecture Topics
– Projects
– Homework
– Tutorial summaries
– Examination Details
9
Introduction
Classroom Etiquette
All laptop computers, cell phones, tablet computers must be closed
during all classroom hours
– If you wish to use a computer, you are welcome to step outside
– Computers distract the most people behind and around the user
– You require a Verification of Illness form to use a computer in class
– The classroom is not for watching the next football match—even if your
country is playing—but you are welcome to sit outside
Bilby
© FIFA
10
Introduction
C++
‫‫‬ You will be using the C++ programming language in this course
Modified for C++ from http://www.foxtrot.com/
11
Introduction
C++
‫‫‬ This course does not teach C++ programming
– You will use C++ to demonstrate your knowledge in this course
‫‫‬ One lecture covers:
– Features of C++ and differences with C#
‫‫‬ An on-line tutorial is available on the course web site
– It assumes minimal knowledge of programming
‫‫‬ Please note: marks in ECE 250 are not strongly correlated with
marks in ECE 150
12
Introduction
C++
‫‫‬ Other sources of help in C++ are:
– The Project T.A.s,
– The lab instructor, and
– The instructor
– Other online tutorials: http://www.cplusplus.com/
‫‫‬ Laboratories are held every second week
– All laboratory material the course web site
– Laboratories is associated with a project
– Project 0 has no marks but allows you to practice C++
13
Introduction
Unix
‫‫‬ You will also be exposed to the Unix environment
– All the projects will be marked in Unix using the g++ compiler
– Its usage is similar to that of the cs command-line compiler for C# used
in ECE 150
‫‫‬ A Unix tutorial is also available
‫‫‬ You can develop your code on Windows, but you are responsible for
testing your code to Unix
14
Introduction
Evaluation
‫‫‬ The course is divided into numerous topics
– Storing ordered and sorted objects
– Storing an arbitrary collection of data
– Sorting objects
– Graphs
– Algorithm Design Techniques
There are two self-study topics:
– Splay trees, and
– Disjoint sets
The self study topics will appear on the final examination as bonus
questions
– A question for each will appear but you may only answer one
15
Introduction
Evaluation
‫‫‬ Your evaluation in this course is based on three components:
– Five equally weighted projects
– One mid-term examination
– One final examination
– A commenting bonus (up to 3%)
‫‫‬ You must pass both the examination component and the project
component separately in order to pass the course
– If you fail either component, your grade is the lesser of the two
– Handing in no projects will result in a grade of zero
16
Introduction
Evaluation
‫‫‬ Your grade G is calculated according to the formula:
where F, M, and P are your marks on your final, mid-term, and
projects, respectively
 
1 2
3 3
5
1 1
2 4 40
15 7 3
4 2 40
3
1
4 4
Let , , and be marks out of 100 and let ;
min 50 or 50
75 50 60 and
then .
225 50 60 and
60 and 60
P M F E M F
E,P E P
E P EP E E P
G
E P EP P P E
P E E P
 
 


     

 
     

   

17
Introduction
Evaluation
‫‫‬ Here is a visual representation:
18
Introduction
Evaluation
‫‫‬ Observations:
– This function is continuous (no threshold marking)
– You must achieve 60% in both the projects and the examinations in
order to have the usual marking scheme of 25% projects, 25% mid-term
examination, and 50% final examination
– You can achieve 100% on both the mid-term and the final examinations
and 50% on the projects, and you will have a grade of 50
19
Introduction
Evaluation
‫‫‬ A student who misses either examination must provide:
– A Verification of Illness form indicating a severe illness, or
– Other formal documentation, as appropriate
‫‫‬ With proper documentation:
– Missing the mid-term examination sets E = F in the formula
– Missing the final examination results in the opportunity to write with the
next offering of the course
‫‫‬ Without proper documentation:
– Missing the mid-term examination results in 0
– Missing the final examination results in DNW and
“Required‫‫‬to‫‫‬Withdraw‫‫‬from‫‫‬Engineering”
‫‫‬ There will be no re-weighting of the mid-term examination under any
circumstances
20
Introduction
Evaluation
‫‫‬ Commenting code is necessary for engineers:
– Engineers who do not comment code will not encourage employees and
contracted programmers to comment their code
– This will lead to significant additional costs
The commenting bonus occurs at the end of the term
– Instructions for commenting code are available on the Projects web site
– Quality comments are required in at least three projects for any marks
to be awarded
21
Introduction
Projects
‫‫‬ For each of the five projects, you will be required to implement one
or more of the data structures taught in class
‫‫‬ We provide an environment in which we test your projects
‫‫‬ The times the projects are due is fixed:
– Projects are due Tuesday at 22:00 (10:00 PM) on Learn
– The drop-box will be kept open until midnight for late submissions
– Maximum grade for late submissions is 70
22
Introduction
Projects
‫‫‬ We provide a interpreter which you can use to test your software
– We will use the same interpreter to test your software
‫‫‬ Your output must perfectly match our output
– Comparisons are done using text comparisons
– Any debugging printouts will cause your project to fail a test
23
Introduction
Projects
‫‫‬ What happens if you make a mistake?
– I will be holding one-on-one sessions with any student who got a grade
on a project below 70
– The maximum grade of your resubmission depends on:
Maximum Grade
You can articulate all errors and give fixes 70
You require assistance in correcting one member function 60
You require significant assistance on two member functions 50
24
Introduction
Projects
‫‫‬ You are allowed to:
– Make multiple submissions—we take the last
– Declare and define other classes and other member functions not
specified in the project descriptions
– You may even, though be very cautious, overload the given member
function signatures or give the functions extra parameters so long as the
functions as specified may be called with no ambiguity
– Use the following standard library functions (and no others):
#include <iostream> all functions and classes
#include <cassert> assert( predicate )
#include <algorithm> std::max( x, y ) std::min( x, y )
The use of any other standard library function or class will result in an
automatic grade of 0
25
Introduction
‫‫‬ You are responsible for the naming convention on the submitted file
uwuserid_pM.tar.gz
where:
uwuserid is your uWaterloo User ID,
M is the number of the project
The execution must always be of the form
tar -cvf uwuserid_pM.tar file1.h file2.h etc.h
gzip uwuserid_pM.tar
Three students failed at life when they submitted
their project with uWaterloo User ID “uwuserid”
Projects
26
Introduction
‫‫‬ In Unix, file names are case sensitive:
– The files j99smithP1.tar.gz and j99smith_p1.tar.gz are
different
‫‫‬ Also, you must use the tar and gzip utilities on Unix
– Using‫‫‬zip‫(‫‬even‫‫‬if‫‫‬you‫‫‬rename‫‫‬it)‫‫‬doesn’t‫‫‬work
‫‫‬ If you cannot submit through uWaterloo LEARN, you must e-mail the
file to the Lab Instructor
– Any penalty is based on the time stamp at which the e-mail is received
(not sent)
– You are responsible for all information on the site
ece.uwaterloo.ca/~dwharder/aads/Projects/
Projects
27
Introduction
Projects
Even xkcd has some advice on
coding...
http://xkcd.com/844/
28
Introduction
The human brain can retain approximately 5-9 independent items of
information in its short-term memory
George Miller, The Magical Number Seven, Plus or Minus Two: Some
Limits on Our Capacity for Processing Information, Psychological
Review, Vol.63 pp.81–97, 1956
The introduction of new information causes the brain to discard an
item currently in your short-term memory
– For example, consider the 12 words which will appear on the next
sequence of screens
Your goal: at the end, write down all twelve words
Improving Your Performance
29
Introduction
Cat
Improving Your Performance
30
Introduction
Ultimate
Improving Your Performance
31
Introduction
Knife
Improving Your Performance
32
Introduction
Asteroid
Improving Your Performance
33
Introduction
Motion
Improving Your Performance
34
Introduction
Shipwreck
Improving Your Performance
35
Introduction
Peach
Improving Your Performance
36
Introduction
Ford
Improving Your Performance
37
Introduction
Pencil
Improving Your Performance
38
Introduction
Metre
Improving Your Performance
39
Introduction
Curtain
Improving Your Performance
40
Introduction
Forever
Improving Your Performance
41
Introduction
‫‫‬ Now, write down as many of these words as you can
– Most of you will be able to write down somewhere between 7 through 9
of these
– It may even be possible to remember more new topics, however, you
will note that there is no relationship between these objects
Improving Your Performance
42
Introduction
‫‫‬ To transfer information from your short-term memory to your long-
term memory, that information must be imposed on your mind at
least three times
‫‫‬ You should always try the following:
– Look at the slides before class
– Attend lectures
• You see the information again with commentary
– Review the lecture during the evening
• Rewrite and summarize the slides in your words
Improving Your Performance
43
Introduction
‫‫‬ In addition to this, you should:
– Get a reasonable nights sleep (apparently this is when information is
transferred to your long-term memory), and
– Eat a good breakfast (also apparently good for the memory)
Improving Your Performance
44
Introduction
Improving Your Performance
‫‫‬ Like other courses, this course builds on previous information
– I will not answer questions about material which I have either previously
covered or indicated that you are required to read
‫‫‬ Also, neither the T.A.s nor myself will be available for help either on
the day of the mid-term or final examinations
– There is no help which can be derived in that time, and therefore, to
impress this upon you, you must study before-hand if you believe you
will need help
45
Introduction
Academic Offences
‫‫‬ Academic Offences include, but are not limited to:
– Infringing unreasonably on the work of other members
• E.g., disrupting classes
– Cheating
– Plagiarism
– Misrepresentations
‫‫‬ All students must read Policy 71
46
Introduction
Plagiarism
‫‫‬ All projects must be done individually:
– You may not copy code directly from any other source
– Plagiarism detection software will be used on all of the projects
– If you viewed another code (from books or lecture notes), you must
include a reference in your project
– You may not share code with any other students by transmitting
completed functions to your peers
• This restriction includes—but is not limited to—electronic and hard-copy
sharing
– You may discuss projects together and help another student debug his
or her code; however, you cannot dictate or give the exact solution
47
Introduction
Plagiarism
‫‫‬ Projects will be submitted to MOSS for plagiarism detection
‫‫‬ (Measure Of Software Similarity)
This plagiarism-detection software hosted on a Stanford University
server and is based on the paper
Winnowing: Local Algorithms for Document Fingerprinting
by Saul Schleimer, Daniel S. Wilkerson, and Alex Aiken
You are only asked for you uWaterloo User ID in both the project
files and the name of the submitted file
– It is not recommended that you include either your full name or your
uWaterloo Student ID Number
48
Introduction
Plagiarism
‫‫‬ Collaboration with other students must be limited to
– Discussions
– High-level pseudocode
– Assistance with debugging (only through the offering of advice)
– Sharing test files
‫‫‬ All such collaborations must be documented in your source code
49
Introduction
Plagiarism
When one student copies from another student, both students are
responsible
– Exceptions are made for outright theft
The penalty for plagiarism on a Project is a mark of 0 on the project in
question and a further 5% is subtracted from your final grade
– Regardless if Projects are counted or not
50
Introduction
Plagiarism
One‫‫‬student‫‫‬cannot‫‫‬accept‫“‫‬full‫‫‬responsibility”
– For example, Alex, Bailey, Casey, and Devin worked together in a group
– They each did their own work, however, they shared code to comment
on each others programming
– Bailey gave‫‫‬Alex’s‫‫‬code‫‫‬to‫‫‬Emerson who copied it for his project and
submitted it
– Alex, Bailey and Emerson received a 0 and –5 %
51
Introduction
Plagiarism: Example 1
‫‫‬ Alex and Bailey were lab partners in ECE 222
‫‫‬ Bailey left herself logged on Unix to allow Alex to complete the lab
‫‫‬ Alex‫‫‬copied‫‫‬Bailey’s‫‫‬ECE‫‫‬250‫‫‬project
52
Introduction
Plagiarism: Example 2
‫‫‬ Leslie asked if Morgan could send her his code so that she could
look at it (promising, of course, not to copy it)
‫‫‬ Morgan sent the code
‫‫‬ Leslie copied it and handed it in
53
Introduction
Plagiarism: Example 3
‫‫‬ Erin did not chance her default password
‫‫‬ Fanny‫‫‬logged‫‫‬onto‫‫‬Erin’s‫‫‬account‫‫‬and‫‫‬took‫‫‬Erin’s‫‫‬code
– Erin is still responsible
54
Introduction
Plagiarism: Example 4
‫‫‬ Garry and Harry worked together on a single source file initially and
then worked separately to finish off the details
‫‫‬ The result was still noticeably similar with finger-print-like
characteristics which left no doubt that some of the code had a
common source
55
Introduction
Plagiarism: Example 5
‫‫‬ Jordan uploaded the projects to GITHUB.com without setting
appropriate permissions. Kasey found this site, downloaded the
projects and submitted them. Both are guilty.
– This applies to any public forum, news group, etc.,‫‫‬not‫‫‬just‫‫‬gitub.com…
56
Introduction
Plagiarism
‫‫‬ The minimum penalty for plagiarism is 0 on the project and –5% on
your final mark for each case of plagiarism
– the penalty is applied regardless of what proportion the Projects are of
your final grade
‫‫‬ A student who cheats must receive a grade lower than a student
who did not hand in a project
57
Introduction
Plagiarism
‫‫‬ All instances of plagiarism are reported to the Associate Dean of
Undergraduate Studies
‫‫‬ The Associate Dean may increase the penalty, including:
– requiring four extra courses in ethics
– a suspension
– expulsion
58
Introduction
Plagiarism
‫‫‬ Please note that if you get 70% on:
– all projects,
– the mid-term examination, and
– the final examination
and you are caught once for plagiarism, your course average will be
61.5
59
Introduction
Plagiarism
‫‫‬ The best way to avoid plagiarism is:
– review the C++ tutorial
– read the project as soon as it is available
– start the project so that there is sufficient time to contact the T.A. or
myself if you have difficulty
– do not give your code to anyone
60
Introduction
Distribution of Information
‫‫‬ Information may be pass to the class through one of two media:
– An announcement in class,
– An e-mail via an e-mail through uWaterloo LEARN
61
Introduction
Summary
‫‫‬ In this topic, we have:
– Outlined the course
– Discussed C++ and the projects
– Improving your performance
– Discussed plagiarism and its consequences
62
Introduction
Usage Notes
• These slides are made publicly available on the web for anyone to
use
• If you choose to use them, or a part thereof, for a course at another
institution, I ask only three things:
– that you inform me that you are using the slides,
– that you acknowledge my work, and
– that you alert me of any mistakes which I made or changes which you
make, and allow me the option of incorporating such changes (with an
acknowledgment) in my set of slides
Sincerely,
Douglas Wilhelm Harder, MMath
dwharder@alumni.uwaterloo.ca
1 de 62

Recomendados

EE337 Course introduction 2018 por
EE337 Course introduction 2018EE337 Course introduction 2018
EE337 Course introduction 2018SaravananVijayakumar4
82 vistas15 diapositivas
CMSC 335 FINAL PROJECT por
CMSC 335 FINAL PROJECTCMSC 335 FINAL PROJECT
CMSC 335 FINAL PROJECTHamesKellor
240 vistas8 diapositivas
3wis_2.pdf por
3wis_2.pdf3wis_2.pdf
3wis_2.pdfaustdali
5 vistas60 diapositivas
Gandhi por
GandhiGandhi
GandhiRajivGandhi Mani
318 vistas4 diapositivas
lecture01_Introduction.pdf por
lecture01_Introduction.pdflecture01_Introduction.pdf
lecture01_Introduction.pdfMarlonMagtibay2
18 vistas74 diapositivas
plc learn por
plc learnplc learn
plc learnRakesh Chauhan
1.3K vistas132 diapositivas

Más contenido relacionado

Similar a 1.01.Introduction.pptx

Syllabus-ET2571-Advanced Applied Signal Processing por
Syllabus-ET2571-Advanced Applied Signal ProcessingSyllabus-ET2571-Advanced Applied Signal Processing
Syllabus-ET2571-Advanced Applied Signal ProcessingMain Uddin-Al-Hasan
53 vistas2 diapositivas
CMIT 265 NETWORK DESIGN PAPER por
CMIT 265 NETWORK DESIGN PAPERCMIT 265 NETWORK DESIGN PAPER
CMIT 265 NETWORK DESIGN PAPERHamesKellor
449 vistas7 diapositivas
EE337 Course Introduction por
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introductionrajbabureliance
39 vistas15 diapositivas
Te computer-syllabus-2015-course-3-4-17 por
Te computer-syllabus-2015-course-3-4-17Te computer-syllabus-2015-course-3-4-17
Te computer-syllabus-2015-course-3-4-17abc19789
662 vistas64 diapositivas
Fundamental control and safety system por
Fundamental control and safety systemFundamental control and safety system
Fundamental control and safety systemIrfan Hakim
84 vistas17 diapositivas

Similar a 1.01.Introduction.pptx(20)

Syllabus-ET2571-Advanced Applied Signal Processing por Main Uddin-Al-Hasan
Syllabus-ET2571-Advanced Applied Signal ProcessingSyllabus-ET2571-Advanced Applied Signal Processing
Syllabus-ET2571-Advanced Applied Signal Processing
CMIT 265 NETWORK DESIGN PAPER por HamesKellor
CMIT 265 NETWORK DESIGN PAPERCMIT 265 NETWORK DESIGN PAPER
CMIT 265 NETWORK DESIGN PAPER
HamesKellor449 vistas
Te computer-syllabus-2015-course-3-4-17 por abc19789
Te computer-syllabus-2015-course-3-4-17Te computer-syllabus-2015-course-3-4-17
Te computer-syllabus-2015-course-3-4-17
abc19789662 vistas
Fundamental control and safety system por Irfan Hakim
Fundamental control and safety systemFundamental control and safety system
Fundamental control and safety system
Irfan Hakim84 vistas
Te computer syllabus 2015 course 3-4-17 3-5-17 por VishalButkar2
Te computer syllabus 2015 course 3-4-17 3-5-17Te computer syllabus 2015 course 3-4-17 3-5-17
Te computer syllabus 2015 course 3-4-17 3-5-17
VishalButkar2378 vistas
Introduction to Programming por ALI RAZA
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
ALI RAZA46 vistas
01 introduction to cpp por Manzoor ALam
01   introduction to cpp01   introduction to cpp
01 introduction to cpp
Manzoor ALam625 vistas
Cocomo model por Baskarkncet
Cocomo modelCocomo model
Cocomo model
Baskarkncet22.1K vistas
Software Development : Jeremy Gleason Iscope Digital por Iscope Digital
Software Development : Jeremy Gleason Iscope DigitalSoftware Development : Jeremy Gleason Iscope Digital
Software Development : Jeremy Gleason Iscope Digital
Iscope Digital242 vistas
agile with scrum methodology por rahul reddy
agile with scrum methodology agile with scrum methodology
agile with scrum methodology
rahul reddy1.5K vistas
M.tech admission in india por Edhole.com
M.tech admission in indiaM.tech admission in india
M.tech admission in india
Edhole.com288 vistas
M.tech admission in india por Edhole.com
M.tech admission in indiaM.tech admission in india
M.tech admission in india
Edhole.com168 vistas
Combining fUML and profiles for non-functional analysis based on model execut... por Luca Berardinelli
Combining fUML and profiles for non-functional analysis based on model execut...Combining fUML and profiles for non-functional analysis based on model execut...
Combining fUML and profiles for non-functional analysis based on model execut...
Luca Berardinelli60 vistas
CMIT 265 Education Redefined / snaptutorial.com por McdonaldRyan211
CMIT 265  Education Redefined / snaptutorial.comCMIT 265  Education Redefined / snaptutorial.com
CMIT 265 Education Redefined / snaptutorial.com
McdonaldRyan21115 vistas
School of Science, Technology, Engineering and MathDepar.docx por kenjordan97598
School of Science, Technology, Engineering and MathDepar.docxSchool of Science, Technology, Engineering and MathDepar.docx
School of Science, Technology, Engineering and MathDepar.docx
kenjordan975989 vistas

Último

The basics - information, data, technology and systems.pdf por
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdfJonathanCovena1
115 vistas1 diapositiva
Narration ppt.pptx por
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptxTARIQ KHAN
135 vistas24 diapositivas
Use of Probiotics in Aquaculture.pptx por
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptxAKSHAY MANDAL
100 vistas15 diapositivas
Class 10 English notes 23-24.pptx por
Class 10 English notes 23-24.pptxClass 10 English notes 23-24.pptx
Class 10 English notes 23-24.pptxTARIQ KHAN
131 vistas53 diapositivas
231112 (WR) v1 ChatGPT OEB 2023.pdf por
231112 (WR) v1  ChatGPT OEB 2023.pdf231112 (WR) v1  ChatGPT OEB 2023.pdf
231112 (WR) v1 ChatGPT OEB 2023.pdfWilfredRubens.com
157 vistas21 diapositivas
Collective Bargaining and Understanding a Teacher Contract(16793704.1).pptx por
Collective Bargaining and Understanding a Teacher Contract(16793704.1).pptxCollective Bargaining and Understanding a Teacher Contract(16793704.1).pptx
Collective Bargaining and Understanding a Teacher Contract(16793704.1).pptxCenter for Integrated Training & Education
93 vistas57 diapositivas

Último(20)

The basics - information, data, technology and systems.pdf por JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena1115 vistas
Narration ppt.pptx por TARIQ KHAN
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
TARIQ KHAN135 vistas
Use of Probiotics in Aquaculture.pptx por AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL100 vistas
Class 10 English notes 23-24.pptx por TARIQ KHAN
Class 10 English notes 23-24.pptxClass 10 English notes 23-24.pptx
Class 10 English notes 23-24.pptx
TARIQ KHAN131 vistas
Solar System and Galaxies.pptx por DrHafizKosar
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptx
DrHafizKosar91 vistas
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx por ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP369 vistas
Psychology KS4 por WestHatch
Psychology KS4Psychology KS4
Psychology KS4
WestHatch84 vistas
Scope of Biochemistry.pptx por shoba shoba
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba133 vistas
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... por Ms. Pooja Bhandare
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Ms. Pooja Bhandare93 vistas
Are we onboard yet University of Sussex.pptx por Jisc
Are we onboard yet University of Sussex.pptxAre we onboard yet University of Sussex.pptx
Are we onboard yet University of Sussex.pptx
Jisc96 vistas
Structure and Functions of Cell.pdf por Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan545 vistas
11.28.23 Social Capital and Social Exclusion.pptx por mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239298 vistas
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively por PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 585 vistas
Psychology KS5 por WestHatch
Psychology KS5Psychology KS5
Psychology KS5
WestHatch93 vistas
Create a Structure in VBNet.pptx por Breach_P
Create a Structure in VBNet.pptxCreate a Structure in VBNet.pptx
Create a Structure in VBNet.pptx
Breach_P75 vistas

1.01.Introduction.pptx

  • 1. ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada ece.uwaterloo.ca dwharder@gmail.com © 2006-2018 by Douglas Wilhelm Harder. Some rights reserved. Welcome to ECE 250 Algorithms and Data Structures
  • 2. 2 Introduction Support WEEF Remember that WEEF is one of the few organizations which will support you throughout your undergraduate career http://www.weef.uwaterloo.ca/
  • 3. 3 Introduction ECE 150 Fundamentals of Programming ECE 150 covered: – The history of computing / objects / types / console I/O – Operators / loops / methods / parameter passing – Selection statements / arrays / strings – Exceptions / debugging – File input / file output – Pointers / unsafe code / linked lists – Collections / multi-dimensional arrays / search algorithms – Sorting algorithms – Object-oriented design / polymorphism / interfaces / inheritance – Abstract class
  • 4. 4 Introduction ECE 150 Fundamentals of Programming These were the basics of programming – The ability to manipulate the computer to perform the required tasks You saw data storage techniques: – Arrays, and – Linked lists (collections were discussed) You saw array accessing/manipulation techniques: – Searching, and – Sorting
  • 5. 5 Introduction ECE 250 Algorithms and Data Structures In this course, we will look at: – Algorithms for solving problems efficiently – Data structures for efficiently storing, accessing, and modifying data We will see that all data structures have trade-offs – There is no ultimate data structure... – The choice depends on our requirements
  • 6. 6 Introduction ECE 250 Algorithms and Data Structures ‫‫‬ Consider accessing the kth entry in an array or linked list – In an array, we can access it using an index array[k] • You will see in ECE 222 that there is a single machine instruction for this – We must step through the first k – 1 nodes in a linked list ‫‫‬ Consider searching for an entry in a sorted array or linked list – In a sorted array, we use a fast binary search • Very fast – We‫‫‬must‫‫‬step‫‫‬through‫‫‬all‫‫‬entries‫‫‬less‫‫‬than‫‫‬the‫‫‬entry‫‫‬we’re‫‫‬looking‫‫‬for • Slow
  • 7. 7 Introduction ECE 250 Algorithms and Data Structures ‫‫‬ However, consider inserting a new entry to the start of an array or a linked list – An array requires that you copy all the elements in the array over • Slow for large arrays – A linked list allows you to make the insertion very quickly • Very fast regardless of size
  • 8. 8 Introduction ECE 250 Algorithms and Data Structures ‫‫‬ All course-related material on the course web site http://ece.uwaterloo.ca/~dwharder/aads/ ‫‫‬ This includes: – The Course Outline – Various tutorials – Lecture Material – Lecture Topics – Projects – Homework – Tutorial summaries – Examination Details
  • 9. 9 Introduction Classroom Etiquette All laptop computers, cell phones, tablet computers must be closed during all classroom hours – If you wish to use a computer, you are welcome to step outside – Computers distract the most people behind and around the user – You require a Verification of Illness form to use a computer in class – The classroom is not for watching the next football match—even if your country is playing—but you are welcome to sit outside Bilby © FIFA
  • 10. 10 Introduction C++ ‫‫‬ You will be using the C++ programming language in this course Modified for C++ from http://www.foxtrot.com/
  • 11. 11 Introduction C++ ‫‫‬ This course does not teach C++ programming – You will use C++ to demonstrate your knowledge in this course ‫‫‬ One lecture covers: – Features of C++ and differences with C# ‫‫‬ An on-line tutorial is available on the course web site – It assumes minimal knowledge of programming ‫‫‬ Please note: marks in ECE 250 are not strongly correlated with marks in ECE 150
  • 12. 12 Introduction C++ ‫‫‬ Other sources of help in C++ are: – The Project T.A.s, – The lab instructor, and – The instructor – Other online tutorials: http://www.cplusplus.com/ ‫‫‬ Laboratories are held every second week – All laboratory material the course web site – Laboratories is associated with a project – Project 0 has no marks but allows you to practice C++
  • 13. 13 Introduction Unix ‫‫‬ You will also be exposed to the Unix environment – All the projects will be marked in Unix using the g++ compiler – Its usage is similar to that of the cs command-line compiler for C# used in ECE 150 ‫‫‬ A Unix tutorial is also available ‫‫‬ You can develop your code on Windows, but you are responsible for testing your code to Unix
  • 14. 14 Introduction Evaluation ‫‫‬ The course is divided into numerous topics – Storing ordered and sorted objects – Storing an arbitrary collection of data – Sorting objects – Graphs – Algorithm Design Techniques There are two self-study topics: – Splay trees, and – Disjoint sets The self study topics will appear on the final examination as bonus questions – A question for each will appear but you may only answer one
  • 15. 15 Introduction Evaluation ‫‫‬ Your evaluation in this course is based on three components: – Five equally weighted projects – One mid-term examination – One final examination – A commenting bonus (up to 3%) ‫‫‬ You must pass both the examination component and the project component separately in order to pass the course – If you fail either component, your grade is the lesser of the two – Handing in no projects will result in a grade of zero
  • 16. 16 Introduction Evaluation ‫‫‬ Your grade G is calculated according to the formula: where F, M, and P are your marks on your final, mid-term, and projects, respectively   1 2 3 3 5 1 1 2 4 40 15 7 3 4 2 40 3 1 4 4 Let , , and be marks out of 100 and let ; min 50 or 50 75 50 60 and then . 225 50 60 and 60 and 60 P M F E M F E,P E P E P EP E E P G E P EP P P E P E E P                           
  • 18. 18 Introduction Evaluation ‫‫‬ Observations: – This function is continuous (no threshold marking) – You must achieve 60% in both the projects and the examinations in order to have the usual marking scheme of 25% projects, 25% mid-term examination, and 50% final examination – You can achieve 100% on both the mid-term and the final examinations and 50% on the projects, and you will have a grade of 50
  • 19. 19 Introduction Evaluation ‫‫‬ A student who misses either examination must provide: – A Verification of Illness form indicating a severe illness, or – Other formal documentation, as appropriate ‫‫‬ With proper documentation: – Missing the mid-term examination sets E = F in the formula – Missing the final examination results in the opportunity to write with the next offering of the course ‫‫‬ Without proper documentation: – Missing the mid-term examination results in 0 – Missing the final examination results in DNW and “Required‫‫‬to‫‫‬Withdraw‫‫‬from‫‫‬Engineering” ‫‫‬ There will be no re-weighting of the mid-term examination under any circumstances
  • 20. 20 Introduction Evaluation ‫‫‬ Commenting code is necessary for engineers: – Engineers who do not comment code will not encourage employees and contracted programmers to comment their code – This will lead to significant additional costs The commenting bonus occurs at the end of the term – Instructions for commenting code are available on the Projects web site – Quality comments are required in at least three projects for any marks to be awarded
  • 21. 21 Introduction Projects ‫‫‬ For each of the five projects, you will be required to implement one or more of the data structures taught in class ‫‫‬ We provide an environment in which we test your projects ‫‫‬ The times the projects are due is fixed: – Projects are due Tuesday at 22:00 (10:00 PM) on Learn – The drop-box will be kept open until midnight for late submissions – Maximum grade for late submissions is 70
  • 22. 22 Introduction Projects ‫‫‬ We provide a interpreter which you can use to test your software – We will use the same interpreter to test your software ‫‫‬ Your output must perfectly match our output – Comparisons are done using text comparisons – Any debugging printouts will cause your project to fail a test
  • 23. 23 Introduction Projects ‫‫‬ What happens if you make a mistake? – I will be holding one-on-one sessions with any student who got a grade on a project below 70 – The maximum grade of your resubmission depends on: Maximum Grade You can articulate all errors and give fixes 70 You require assistance in correcting one member function 60 You require significant assistance on two member functions 50
  • 24. 24 Introduction Projects ‫‫‬ You are allowed to: – Make multiple submissions—we take the last – Declare and define other classes and other member functions not specified in the project descriptions – You may even, though be very cautious, overload the given member function signatures or give the functions extra parameters so long as the functions as specified may be called with no ambiguity – Use the following standard library functions (and no others): #include <iostream> all functions and classes #include <cassert> assert( predicate ) #include <algorithm> std::max( x, y ) std::min( x, y ) The use of any other standard library function or class will result in an automatic grade of 0
  • 25. 25 Introduction ‫‫‬ You are responsible for the naming convention on the submitted file uwuserid_pM.tar.gz where: uwuserid is your uWaterloo User ID, M is the number of the project The execution must always be of the form tar -cvf uwuserid_pM.tar file1.h file2.h etc.h gzip uwuserid_pM.tar Three students failed at life when they submitted their project with uWaterloo User ID “uwuserid” Projects
  • 26. 26 Introduction ‫‫‬ In Unix, file names are case sensitive: – The files j99smithP1.tar.gz and j99smith_p1.tar.gz are different ‫‫‬ Also, you must use the tar and gzip utilities on Unix – Using‫‫‬zip‫(‫‬even‫‫‬if‫‫‬you‫‫‬rename‫‫‬it)‫‫‬doesn’t‫‫‬work ‫‫‬ If you cannot submit through uWaterloo LEARN, you must e-mail the file to the Lab Instructor – Any penalty is based on the time stamp at which the e-mail is received (not sent) – You are responsible for all information on the site ece.uwaterloo.ca/~dwharder/aads/Projects/ Projects
  • 27. 27 Introduction Projects Even xkcd has some advice on coding... http://xkcd.com/844/
  • 28. 28 Introduction The human brain can retain approximately 5-9 independent items of information in its short-term memory George Miller, The Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Processing Information, Psychological Review, Vol.63 pp.81–97, 1956 The introduction of new information causes the brain to discard an item currently in your short-term memory – For example, consider the 12 words which will appear on the next sequence of screens Your goal: at the end, write down all twelve words Improving Your Performance
  • 41. 41 Introduction ‫‫‬ Now, write down as many of these words as you can – Most of you will be able to write down somewhere between 7 through 9 of these – It may even be possible to remember more new topics, however, you will note that there is no relationship between these objects Improving Your Performance
  • 42. 42 Introduction ‫‫‬ To transfer information from your short-term memory to your long- term memory, that information must be imposed on your mind at least three times ‫‫‬ You should always try the following: – Look at the slides before class – Attend lectures • You see the information again with commentary – Review the lecture during the evening • Rewrite and summarize the slides in your words Improving Your Performance
  • 43. 43 Introduction ‫‫‬ In addition to this, you should: – Get a reasonable nights sleep (apparently this is when information is transferred to your long-term memory), and – Eat a good breakfast (also apparently good for the memory) Improving Your Performance
  • 44. 44 Introduction Improving Your Performance ‫‫‬ Like other courses, this course builds on previous information – I will not answer questions about material which I have either previously covered or indicated that you are required to read ‫‫‬ Also, neither the T.A.s nor myself will be available for help either on the day of the mid-term or final examinations – There is no help which can be derived in that time, and therefore, to impress this upon you, you must study before-hand if you believe you will need help
  • 45. 45 Introduction Academic Offences ‫‫‬ Academic Offences include, but are not limited to: – Infringing unreasonably on the work of other members • E.g., disrupting classes – Cheating – Plagiarism – Misrepresentations ‫‫‬ All students must read Policy 71
  • 46. 46 Introduction Plagiarism ‫‫‬ All projects must be done individually: – You may not copy code directly from any other source – Plagiarism detection software will be used on all of the projects – If you viewed another code (from books or lecture notes), you must include a reference in your project – You may not share code with any other students by transmitting completed functions to your peers • This restriction includes—but is not limited to—electronic and hard-copy sharing – You may discuss projects together and help another student debug his or her code; however, you cannot dictate or give the exact solution
  • 47. 47 Introduction Plagiarism ‫‫‬ Projects will be submitted to MOSS for plagiarism detection ‫‫‬ (Measure Of Software Similarity) This plagiarism-detection software hosted on a Stanford University server and is based on the paper Winnowing: Local Algorithms for Document Fingerprinting by Saul Schleimer, Daniel S. Wilkerson, and Alex Aiken You are only asked for you uWaterloo User ID in both the project files and the name of the submitted file – It is not recommended that you include either your full name or your uWaterloo Student ID Number
  • 48. 48 Introduction Plagiarism ‫‫‬ Collaboration with other students must be limited to – Discussions – High-level pseudocode – Assistance with debugging (only through the offering of advice) – Sharing test files ‫‫‬ All such collaborations must be documented in your source code
  • 49. 49 Introduction Plagiarism When one student copies from another student, both students are responsible – Exceptions are made for outright theft The penalty for plagiarism on a Project is a mark of 0 on the project in question and a further 5% is subtracted from your final grade – Regardless if Projects are counted or not
  • 50. 50 Introduction Plagiarism One‫‫‬student‫‫‬cannot‫‫‬accept‫“‫‬full‫‫‬responsibility” – For example, Alex, Bailey, Casey, and Devin worked together in a group – They each did their own work, however, they shared code to comment on each others programming – Bailey gave‫‫‬Alex’s‫‫‬code‫‫‬to‫‫‬Emerson who copied it for his project and submitted it – Alex, Bailey and Emerson received a 0 and –5 %
  • 51. 51 Introduction Plagiarism: Example 1 ‫‫‬ Alex and Bailey were lab partners in ECE 222 ‫‫‬ Bailey left herself logged on Unix to allow Alex to complete the lab ‫‫‬ Alex‫‫‬copied‫‫‬Bailey’s‫‫‬ECE‫‫‬250‫‫‬project
  • 52. 52 Introduction Plagiarism: Example 2 ‫‫‬ Leslie asked if Morgan could send her his code so that she could look at it (promising, of course, not to copy it) ‫‫‬ Morgan sent the code ‫‫‬ Leslie copied it and handed it in
  • 53. 53 Introduction Plagiarism: Example 3 ‫‫‬ Erin did not chance her default password ‫‫‬ Fanny‫‫‬logged‫‫‬onto‫‫‬Erin’s‫‫‬account‫‫‬and‫‫‬took‫‫‬Erin’s‫‫‬code – Erin is still responsible
  • 54. 54 Introduction Plagiarism: Example 4 ‫‫‬ Garry and Harry worked together on a single source file initially and then worked separately to finish off the details ‫‫‬ The result was still noticeably similar with finger-print-like characteristics which left no doubt that some of the code had a common source
  • 55. 55 Introduction Plagiarism: Example 5 ‫‫‬ Jordan uploaded the projects to GITHUB.com without setting appropriate permissions. Kasey found this site, downloaded the projects and submitted them. Both are guilty. – This applies to any public forum, news group, etc.,‫‫‬not‫‫‬just‫‫‬gitub.com…
  • 56. 56 Introduction Plagiarism ‫‫‬ The minimum penalty for plagiarism is 0 on the project and –5% on your final mark for each case of plagiarism – the penalty is applied regardless of what proportion the Projects are of your final grade ‫‫‬ A student who cheats must receive a grade lower than a student who did not hand in a project
  • 57. 57 Introduction Plagiarism ‫‫‬ All instances of plagiarism are reported to the Associate Dean of Undergraduate Studies ‫‫‬ The Associate Dean may increase the penalty, including: – requiring four extra courses in ethics – a suspension – expulsion
  • 58. 58 Introduction Plagiarism ‫‫‬ Please note that if you get 70% on: – all projects, – the mid-term examination, and – the final examination and you are caught once for plagiarism, your course average will be 61.5
  • 59. 59 Introduction Plagiarism ‫‫‬ The best way to avoid plagiarism is: – review the C++ tutorial – read the project as soon as it is available – start the project so that there is sufficient time to contact the T.A. or myself if you have difficulty – do not give your code to anyone
  • 60. 60 Introduction Distribution of Information ‫‫‬ Information may be pass to the class through one of two media: – An announcement in class, – An e-mail via an e-mail through uWaterloo LEARN
  • 61. 61 Introduction Summary ‫‫‬ In this topic, we have: – Outlined the course – Discussed C++ and the projects – Improving your performance – Discussed plagiarism and its consequences
  • 62. 62 Introduction Usage Notes • These slides are made publicly available on the web for anyone to use • If you choose to use them, or a part thereof, for a course at another institution, I ask only three things: – that you inform me that you are using the slides, – that you acknowledge my work, and – that you alert me of any mistakes which I made or changes which you make, and allow me the option of incorporating such changes (with an acknowledgment) in my set of slides Sincerely, Douglas Wilhelm Harder, MMath dwharder@alumni.uwaterloo.ca