Lecture 13: Review And Wrap-up - Northeastern University

2y ago
19 Views
2 Downloads
2.84 MB
15 Pages
Last View : 16d ago
Last Download : 3m ago
Upload by : Kamden Hassan
Transcription

Lecture 13: Review and Wrap-upCS5001 / CS5003:Intensive Foundationsof Computer SciencePDF of this presentation1

Lecture 13: Review and Wrap-upYou have learned a lot of things this semester! The final exam will be cumulative,meaning that it will cover everything during the semester. There will be a focus onthe material since the midterm.The exam will be a 3-hour exam in class on Tuesday, December 10th, from 6pm9pm (or 7pm-10pm, if you want -- you can start at either time).The exam will be on BlueBook again, and you should already have the program onyour computer.We will review tonight, and on Thursday there is an optional lab where we can alsoreview, or you can work on assignment 8.2

Lecture 13: Review and Wrap-upHere are the topics that we have covered in the course:Pre-midterm:VariablesBasic types: int, float, strLibrary functionsBranching: if / elif / else, not, or, and, , ! , , , , IterationLists, list slicing, list comprehensionTuplesCreating your own functionsstrings and f-stringsrecursiondictionariesfile processing3

Lecture 13: Review and Wrap-upPost-midterm:Object oriented programmingCreating classesinit , str , selfInheritanceStacksQueuesSearchingLinear SearchBinary SearchSortingInsertion Sort, Selection Sort, Merge Sort, Quicksort (and Radix Sort)Using Python for AIIterators, Generators, Lambda Functions, and Sets4

Lecture 13: Review and Wrap-upStudy Tips1. Review lecture slides -- make sure you understand all example code2. Review all labs3. Review all assignments4. Review Exam Reference Sheet5. Review your midterm and make sure you understand what you missed (andwould get it right if you did it again!)6. Do the practice exam: al/final-practice.zip7. Ask questions on Piazza about concepts or programs you don't understand5

Lecture 13: Review and Wrap-upPost-midterm:Object oriented programmingCreating classesinit , str , eq , selfInheritanceBe prepared to create a class with an init , str , andeq functionsBe prepared to create an inherited class that calls rBe prepared to use classes provided for you6

Lecture 13: Review and Wrap-upPost-midterm:StacksUnderstand the first-in-last-out nature of a stackUnderstand what the push, pop, top, and empty functions doBe prepared to create a stack using a listBe prepared to use a stack to solve problems that can benefit from the use of astack7

Lecture 13: Review and Wrap-upPost-midterm:QueuesUnderstand the first-in-first-out nature of a queueBe prepared to create a queue from a listUnderstand what the enqueue, dequeue, front, and empty functions doBe prepared to use a queue in a program to solve a problem8

Lecture 13: Review and Wrap-upPost-midterm:SearchingLinear SearchBinary SearchUnderstand the difference between a linear search and binary searchBe able to trace a binary search and explain how it works. Make sure youremember that in order to do a binary search, the elements must be sorted9

Lecture 13: Review and Wrap-upPost-midterm:SortingInsertion Sort, Selection Sort, Merge Sort, Quicksort (and Radix Sort)Be able to explain all of the above sorts (except Radix sort)Be able to actually code selection sort and insertion sortBe able to talk about why merge sort is, on average, much faster than insertionsortBe able to talk about why selection sort is never fast10

Lecture 13: Review and Wrap-upPost-midterm:Using Python for AIIterators, Generators, Lambda Functions, and SetsWe won't ask specific questions about AI, nor will we ask about iterators,generators, lambda functions, or sets.11

Lecture 13: Review and Wrap-upWhere to go from hereYou are prepared for your next class, CS 5004 - Object-Oriented DesignThe class is taught in Java, which means that you will need to learn a new programminglanguage. Java is similar to Python in many ways, but it is also different in many ways.You will find it relatively easy to learn Java, but some things will be tricky to remember.Here is an example of the similarities and differences between Python and Java:Java1 class Main {public static void main(String[] args) {2for (int i 0; i 10; i ) {3System.out.println("Java " Integer.toString(i));4}56}7 }Python1 def main():for i in range(10):2print(f"Python {i}")345 if name " main ":6main()Some differences:Java has curly braces for blocks. Indentation is optional (though recommended)for loops look different (and require parentheses)Variables must have the type (e.g., int i)Statements end with a semicolon (;) in Java12

Lecture 13: Review and Wrap-upAnother example:12345678910111213141516171819202122import java.util.ArrayList; // import the ArrayList classimport java.util.Scanner;class Main {public static void main(String[] args) {// create a listArrayList String myList new ArrayList String ();while (true) {System.out.print("Please enter a name (blank line to end): ");Scanner in new Scanner(System.in);String s in.nextLine();if (s.isEmpty()) {break;}myList.add(s);}System.out.println("You entered:");for (String s : myList) {System.out.println(s);}}}Yes, Java does look different! See the next slide for the equivalent Python program.13

Lecture 13: Review and Wrap-upAnother example:1 def main():2my list []3while True:4s input("Please enter a name (blank line to end): ")5if s '':6break7my list.append(s)8print("You entered:")9for s in my list:10print(s)1112 if name " main ":13main()Python programs tend to be shorter than Java programs. But, there are somesimilarities:There are while loops and for loops in both.Lists and ArrayLists are similarBoth have break statementsBoth use dot notation14

Lecture 13: Review and Wrap-upThe bottom line: you will be able to learn Java relatively quickly, despite thedifferences.You have learned programming skills that translate across languages.You have learned problem solving skills that translate across languages.You should be proud of how far you've come during the semester, and good luck asyou go forward to your future classes in the Align program!15

Lecture 13: Review and Wrap-up Post-midterm: Sorting Insertion Sort, Selection Sort, Merge Sort, Quicksort (and Radix Sort) Be able to explain all of the abo ve sorts (except Radix sort) Be able to actually code selection sort and insertion sort Be able to talk about wh y me

Related Documents:

Introduction of Chemical Reaction Engineering Introduction about Chemical Engineering 0:31:15 0:31:09. Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 20 Lecture 21 Lecture 22 Lecture 23 Lecture 24 Lecture 25 Lecture 26 Lecture 27 Lecture 28 Lecture

(Note: Tape and caulk should only be used for securing purposes and should not be used as primary flashing material.) BARRICADE BUILDING WRAP APPLICATION WITH EXISTING WINDOWS 2 3 4 HOUSE WRAP INSTALLATION FOR BARRICADE WRAP BARRICADE WRAP PLUS BARRICADE R-WRAP 1 BARRICADE BP.COM BARRICADE INSTALLATION GUIDE: HOUSE WRAP / FLASHING

Lecture 1: A Beginner's Guide Lecture 2: Introduction to Programming Lecture 3: Introduction to C, structure of C programming Lecture 4: Elements of C Lecture 5: Variables, Statements, Expressions Lecture 6: Input-Output in C Lecture 7: Formatted Input-Output Lecture 8: Operators Lecture 9: Operators continued

Brace Thigh Liner Brace Knee Wrap STEP 3: Front side of the knee wrap has a tag on it. With front of brace and knee wrap facing toward you, place one loop of knee wrap over the plastic condyle cup on the brace as shown. Secure the remaining loop around the plastic condyle cup. Wrap will be stretched

WRAP TOP in collaboration with. 6D 27 7C 28 7D 2. 6E 28 7D 29 7E. 6F 7E 7F 8F 29 30. 6G 7F 7G 8G 30 31 GRAINLINE in collaboration with. 6H 7G 8H 31 32. 9G 33 8F. 9G 9G 33 34 8G SLEEVE CUT 1 PAIR WRAP TOP 5. 9G 34 35 8H WRAP TOP 5. Title: WRAP TOP - A4 Created Date:

Lecture 1: Introduction and Orientation. Lecture 2: Overview of Electronic Materials . Lecture 3: Free electron Fermi gas . Lecture 4: Energy bands . Lecture 5: Carrier Concentration in Semiconductors . Lecture 6: Shallow dopants and Deep -level traps . Lecture 7: Silicon Materials . Lecture 8: Oxidation. Lecture

TOEFL Listening Lecture 35 184 TOEFL Listening Lecture 36 189 TOEFL Listening Lecture 37 194 TOEFL Listening Lecture 38 199 TOEFL Listening Lecture 39 204 TOEFL Listening Lecture 40 209 TOEFL Listening Lecture 41 214 TOEFL Listening Lecture 42 219 TOEFL Listening Lecture 43 225 COPYRIGHT 2016

Partial Di erential Equations MSO-203-B T. Muthukumar tmk@iitk.ac.in November 14, 2019 T. Muthukumar tmk@iitk.ac.in Partial Di erential EquationsMSO-203-B November 14, 2019 1/193 1 First Week Lecture One Lecture Two Lecture Three Lecture Four 2 Second Week Lecture Five Lecture Six 3 Third Week Lecture Seven Lecture Eight 4 Fourth Week Lecture .