/
CS 235 – Data Structures CS 235 – Data Structures

CS 235 – Data Structures - PowerPoint Presentation

tatyana-admore
tatyana-admore . @tatyana-admore
Follow
349 views
Uploaded On 2019-12-16

CS 235 – Data Structures - PPT Presentation

CS 235 Data Structures Fall 2019 Section 001 100 150 pm MWF B092 JFSB Section 002 200 250 pm MWF B092 JFSB Instructor Paul Roper Office TMCB 3370 4228149 Office Hours 1000 1050 am MWF ID: 770560

memory introduction 235 data introduction memory data 235 int lab source compiler files class auto leaks check visual studio

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "CS 235 – Data Structures" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

CS 235 – Data Structures Fall 2019Section 001, 1:00 – 1:50 pm MWF (B092 JFSB)Section 002, 2:00 – 2:50 pm MWF (B092 JFSB)Instructor: Paul Roper Office: TMCB 3370, 422-8149Office Hours: 10:00 - 10:50 am MWFEmail: proper@cs.byu.edu Introduction (01) 1

Tip #1: Don’t Get Behind If you find yourself struggling with the material, falling behind on assignments, facing personal problems, lacking motivation, or any experiencing any difficulty that effects your school work…Resolving problems sooner is always better than later.Talk with the professor at the first sign of problems.Attend all lectures and help sessions.Work with the TAs – especially in morning hours.Maximize deadlines met.Run to completion – avoid context switching (distractions).There is little that can be done to improve your grade if you wait until reading day.Introduction (01) 2

students.cs.byu /~cs235taIntroduction (01)3

CS 235 Syllabus4

Learning Outcomes CS 235 is an introductory course in data structures and algorithms.Data Computing Fundamentals - Learn the strengths and weaknesses of a variety of data structures, so you can choose the best data structure for your data and applications (lists, stacks, queues, priority queues, sets, maps, trees, etc.).Analysis - Apply basic algorithm analysis.Recursion - Understand how recursion works and write programs using recursion to solve problems.Sorting and Searching Algorithms - Learn many of the algorithms commonly used to sort data, so your applications will perform efficiently when sorting large datasets.Program Writing - Implement of each data structure, so you understand how they work under the hood (using an IDE.) Introduction (01)5

CS 235 Prerequisites Students must have completed CS 142 (or an equivalent) with a passing grade before taking CS 235.Students cannot retake CS 235 for a 2nd time without fulfilling the CS department retake policy.We make the following assumptions in CS 235:You have previously taken and passed an introductory programming course.You know the C++ programming language. You understand the basic principles of object-oriented programming (classes, objects, methods, inheritance, etc.)Introduction (01) 6 If you have not satisfied any of the above prerequisites, you will be dropped the course.

Grading Policy Weighted contribution to your final grade:Programming Labs: 60%Auto-graded: 40%Peer Review: 10%Review Assignments: 10%Exams: 40%Pre-Exam: 5%Midterms Exam I & II: 20%Final Exam: 15% Attendance Quizzes: 5% (extra credit)All exams will be proctored in the Testing Center.Quizzes will be available on class website on the day of the class – the quiz code is given during class time and expires at the end of the next day.Drop one lab – choose wisely!To receive an A grade, you must complete (fully functional) 10 of the 11 required labs and score 70% or better on the final exam. A = 93% C = 73% A- = 90% C- = 70% B+ = 87% D+ = 67% B = 83% D = 63% B- = 80% D- = 60% C+ = 77% E = below 60% Introduction (01) 7

Programming Assignments (60%) Auto-graded lab submission.Submit your zipped lab source using the Labs tab on the class website.Your submitted lab source will be compiled using a lab g++ compiler.Command line arguments will be used to specify both input and output test files.An auto-grader will compare your output files with expected results for several test case input files.You may re-submit your zipped source as many times as you like. Your highest score will be recorded.Points will be deducted for any detected memory leaks, warnings, and/or out-of-bounds array references. Random, anonymous peer reviews.Only on-time, zipped solutions accepted for peer review.Results returned via email and recorded in BYU grades. Use an unique coding pseudo-name (e.g. Cody Coder III, Franky Forloop, Doesy Dowhile) on source headers.Lab assignments submitted after the due date will automatically receive a 50% penalty and NOT participate in the peer review process.Introduction (01) 8

Miscellaneous DO NOT post your work on a public repository (e.g. github, Learning Suite, Bitbucket, etc)! We troll often – results in failing the course.Private repositories are encouraged.Do your own work.Sources compared with past and current submissions.Don’t sell your integrity for a mess of pottage.Check your email often.Do not use Learning Suite email to communicate with me.Use proper@cs.byu.edu.Please, avoid using laptops or other electronic devices in class – break out the pencil and paper.Introduction (01) 9 Questions?

C++ Primer 6Part 1: Abstract Data Types Ch01: Introduction to Software DesignCh02: Program Correctness and EfficiencyCh03: Inheritance and Class Hierarchies6L1: Grades L2: SNAPPart 2: ContainersCh04: Sequential ContainersCh05: StacksCh06: Queues and Deques6L3: Linked ListL4: IteratorL5: Shunting Yard L6: Railroad Part 3: Recursion Ch07: Recursion 6 L7: 3dMaze Part 4: Trees, Maps, Sets Ch08: Trees Ch09: Sets and Maps 6 L8: BST L9: Maps and Sets Part 5: Sorting, Search Ch10: Sorting 6 L10: Quicksort Part 6: AVL Trees and Graphs Ch11: Self-Balancing Search Trees Ch12: Graphs 6 L11: AVL (Bonus) CS 235 Overview Introduction (01) 10

Visual Studio 11

Why Use An IDE? “Real men (and women) use plain text editors to write code in assembly.” Industry needs skilled developers who know how to: Use breakpoints Single step Inspect / change process memory Symbolic debuggers highlight scope, keywords, vertical whitespace, outline modules, performance, variable watch, among others. Machine Code Assembly C C++ Java Python Symbolic Debugger Introduction (01) 12

Visual Studio Community 2017 Step 1: Go to website http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_2Step 2: Find the panel titled  Visual Studio Community 2017 for Windows Desktop  and click on . Introduction (01)13

Xcode for Macs C++ is a standard not an application.Your source code should compile and execute independent of what compiler or IDE you choose (VS, Xcode, gcc, g++).Visual Studio uses Microsoft C++ Compiler (MSVC).Xcode uses Clang C/C++/Objective-C compiler frontend with LLVM as backend.Linux, MinGW, Cygwin use GNU gcc compiler.gcc will compile: *.c/*.cpp files as C and C++ respectively. g++ will compile: *.c/*.cpp files but they will all be treated as C++ files.g++ automatically links in the std C++ libraries (gcc does not.)The auto-grader uses the g++ compiler for auto-grading. Always include the VS crt macros in your main source file.https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/FindingLeakedMemory.htmlThing to avoid:Special library calls (e.g. getenv("MYARQ"))https://www.youtube.com/watch?v=FzuDUnoNQo0https://jtdaugh.github.io/xcode-umich/Introduction (01) 14

Memory Leaks 15

Memory Leaks Memory leak - failure to correctly deallocate memory that was previously allocated.Particularly serious issue for programs like daemons and servers which never terminate.Among the most subtle and hard-to-detect bugs.As such, all labs are required to be free from memory leaks.#define _CRTDBG_MAP_ALLOC #include < stdlib.h>#include <crtdbg.h >#define VS_MEM_CHECK _CrtSetDbgFlag \ (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);int main(){ VS_MEM_CHECK // check for memory leaks int * var = new int(5); return 0; } Introduction (01) 16 Basically, a memory leak occurs when you call new without calling a corresponding delete later. int main() { // OK int *p = new int; delete p; // Memory leak int *q = new int; // no delete }