 Gearing up for the stretch run CSCI 21, Spring 2013.

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Chapter 17 Linked Lists.
Linked List 1. Introduction to Linked List 2. Node Class 3. Linked List 4. The Bag Class with Linked List.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 16 – Shopping List Application: Introducing.
Programming In C++ Spring Semester 2013 Lecture 11 Programming In C++, Lecture 11 By Umer Rana.
Copyright 2013 – Noah Mendelsohn Compiling C Programs Noah Mendelsohn Tufts University Web:
Contest format 5 hours, around 8-12 problems One computer running (likely)Linux, plus printer 3 people on one machine No cell phones, calculators, USB.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.c files.
CS112: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Blackboard – Piazza – Textbook Highlight.
CSE 113 Introduction to Computer Programming Lecture slides for Week 10 Monday, October 31 th, 2011 Instructor: Scott Settembre.
Wednesday, 12/4/02, Slide #1 CS 106 Intro to Comp. Sci. 1 Wednesday, 12/4/02  Questions?  Return Test #2  General discussion of HW #05  Introduction.
Introduction to Analysis of Algorithms
Environment & tools Assistant Anssi Jääskeläinen Visiting hours: Tuesdays Room: 6606
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
How to make a SIGGRAPH paper while having all the fun 
Discussion 2: PA1 Siarhei Vishniakou CSE 100 Summer 2014.
Guide To UNIX Using Linux Third Edition
G++ and make Dan Wilson CS193 02/01/06. The g++ Compiler What happens when you call g++ to build your program? Phase 1, Compilation:.cpp files are compiled.
CS211: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Piazza – Textbook Highlight important.
WEEK 1 CS 361: ADVANCED DATA STRUCTURES AND ALGORITHMS Dong Si Dept. of Computer Science 1.
C++ / G4MICE Course Session 3 Introduction to Classes Pointers and References Makefiles Standard Template Library.
COMP 111 Programming Languages 1 First Day. Course COMP111 Dr. Abdul-Hameed Assawadi Office: Room AS15 – No. 2 Tel: Ext. ??
Introduction to Computing Concepts Note Set 11. Other ways of interacting with Java programs There are: ▫ GUI programs ▫ Web-based applets (GUI programs.
 200 Total Points ◦ 74 Points Writing Programs ◦ 60 Points Tracing Algorithms and determining results ◦ 36 Points Short Answer ◦ 30 Points Multiple Choice.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
Author: Venue: Date: Hints & Tips Author: Bob Guinn & Ann Austin Venue: UWL Date: Mar
Pointers OVERVIEW.
Linked Lists part 2 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
Current Assignments Homework 2 is available and is due in three days (June 19th). Project 1 due in 6 days (June 23 rd ) Write a binomial root solver using.
Complete Branding with Video Kit Part2 Everything you need included (does not include items you already have)
C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.
CS 307 Fundamentals of Computer ScienceLinked Lists 1 Topic 14 Linked Lists "All the kids who did great in high school writing pong games in BASIC for.
Makefiles, Geany CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Winter 2006CISC121 - Prof. McLeod1 Stuff Deadline for assn 3 extended to Monday, the 13 th. Please note that the testing class for assn 3 has changed.
 200 Total Points ◦ 75 Points Writing Programs ◦ 60 Points Tracing Algorithms and determining results ◦ 35 Points Short Answer ◦ 30 Points Multiple Choice.
Application Software System Software.
Modular Programming. Introduction As programs grow larger and larger, it is more desirable to split them into sections or modules. C allows programs to.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
Linked Lists. Array List Issues Painful insert/remove at start/middle.
CS112: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Blackboard – Piazza – Textbook Highlight.
Reading from a file, Sorting, and a little Searching Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics,
Announcements Assignment 1 will be regraded for all who’s score (not percentage) is less than 6 (out of 65). If your score is 6 or higher, but you feel.
Winter 2006CISC121 - Prof. McLeod1 Stuff Solution to midterm is posted. Marking has just started… Lab for this week is not posted (yet?). Final exam (full.
1 Linked List. Outline Introduction Insertion Description Deletion Description Basic Node Implementation Conclusion.
Dr. Sajib Datta Jan 15,  Instructor: Sajib Datta ◦ Office Location: ERB 336 ◦ Address: ◦ Web Site:
Brandon Packard. Why make? So far, you have probably worked on relatively small projects Coding projects can become huge My research consists of 1600.
Quiz 1 A sample quiz 1 is linked to the grading page on the course web site. Everything up to and including this Friday’s lecture except that conditionals.
1 CS 192 Lecture 4 Winter 2003 December 8-9, 2003 Dr. Shafay Shamail.
Unit – I Lists.
Compilation and Debugging
Compilation and Debugging
A Bag Implementation that Links Data
Linked Lists.
LINKED LISTS CSCD Linked Lists.
Prof. Neary Adapted from slides by Dr. Katherine Gibson
CS 2308 Final Exam Review.
Announcements Homework #7 due Monday at 3:00pm
Chapter 6 System and Application Software
Remembering lists of values lists
Linked List and Selection Sort
LMC Little Man Computer What do you know about LMC?
Chapter 6 System and Application Software
Chapter 6 System and Application Software
Chapter 6 System and Application Software
Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the.
CS 2308 Final Exam Review.
SPL – PS1 Introduction to C++.
Presentation transcript:

 Gearing up for the stretch run CSCI 21, Spring 2013

Some tips  Search for answers on Google  Watch YouTube videos  Find a student or students in the class who are doing well and put together a study group  Do not leave lab hours when you finish your programming challenge – stay around and get help on your projects  Take advantage of the instructor’s office hours and (priority answers are given to those who attend ALL of our lecture and lab meeting hours)

Some tips (cont.)  Read the book before coming to class  be prepared to ask questions in class  Attempt the programming challenge before coming to class  be prepared to ask questions in class  We all know this is a very difficult class, and it requires a lot of hard work on your part – unfortunately, there is no easier way to learn this stuff  minimum (‘C’ effort) time spent each week outside of class: 6 hours

More tips  Read each project carefully as soon as it is posted – ask for clarification in lecture, lab,by , or in office hours when needed  Start your project early (as soon as it is posted)  Try and keep your code in a compiling state constantly  Strive to do more than the bare minimum – ‘C’ students do the bare minimum

Makefile  always named Makefile  not makefile, or makefile.txt, or anything else  always do the following  have a target to link the executable  have a target to compile each class separately  have a target to compile the driver separately  have a target to clean (rm/del *.o)  have a target to cleanall (rm/del *.o and.exe)

Makefile (cont.)  What does a Makefile do?  runs a series of compiler/linker commands for you  make  allows you to specify a single target and only run that single command  make target  What is a target?  one compiler or linker command

Makefile (cont.)  example: a program that only has a single source file source file: myprogram.cpp Makefile: myprogram.exe: myprogram.o g++ -o myprogram.exe myprogram.o myprogram.o: myprogram.cpp g++ -c myprogram.cpp

Makefile (cont.)  example: a program that only has a single source file  make  executes the topmost target and all of its dependencies  typing make on the Makefile on the last slide would cause the following to happen:  topmost target: myprogram.exe (executes second)  dependency: myprogram.o (executes first)  result: if no compiler/linker errors, will create myprogram.o and then myprogram.exe

Makefile (cont.)  example: a program that only has a single source file  make myprogram.o  only executes the command associated with the target myprogram.o

Makefile (cont.)  example: a program that has several source files source file: myprogram.cpp, myclass.cpp, myhelper.cpp, myclass.h, myhelper.h Makefile: myprogram.exe: myprogram.o myclass.o myhelper.o g++ -o myprogram.exe myprogram.o myclass.o myhelper.o myprogram.o: myprogram.cpp g++ -c myprogram.cpp myclass.o: myclass.cpp g++ -c myclass.cpp myhelper.o: myhelper.cpp g++ -c myhelper.cpp

Makefile (cont.)  example: a program that has several source files  now you can type any of the following make commands:  make (topmost target and all of its dependencies)  make myprogram.o  make myclass.o  make myhelper.o

Makefile (cont.)  add clean and cleanall targets to your Makefile Windows clean: cmd /C del *.o cleanall: clean cmd /C del myprogram.exe

Makefile (cont.)  add clean and cleanall targets to your Makefile Mac/Linux clean: rm –f *.o cleanall: clean rm -f myprogram.exe

Makefile -- exercise  Create a Makefile to compile the following source files and build an executable that links them all together:  executable: project3.exe  source files:  project3.cpp  DLNode.cpp, DLNode.h  DLList.cpp, DLList.h  clean and cleanall targets

Project 3  Hopefully you have read the Project 3 specs, which were posted on Wednesday evening, March 27  The spec is complex, so will require your careful attention  Questions or any points of clarification?

Project 3 – getting started  How do I start Project 3 when I do not know how to code a linked list?  First Iteration  stub out the classes and driver  create a Makefile  make  Second Iteration  stub out the functions in the DLNode class  make

Project 3 – getting started (cont.)  Third Iteration  stub out the functions in the DLList class  make  Fourth Iteration and on…  implement a function in DLNode or DLList (complete DLNode before moving on to DLList)  make  implement a test of the function in your driver  make  run the executable to view the test output

Project 3 – getting started (cont.)  Final Iterations  after all of the functions have been implemented and tested, clear out your driver and begin implementing the driver as needed for the final project  do it in steps – one small part of the driver functionality, make, run executable  When you think you have everything in place  test with many, many input files – do your best to break your program before you have to submit it

Linked lists  What is a linked list?  a data structure  what is a data structure?  a dynamic data structure  grows and shrinks as you add/remove data  dynamic: think dynamic memory  dynamic memory: think pointers  built by linking nodes

Linked lists (cont.)  What is a node?  a container for a piece of data and one or more links (pointers) to other nodes  linked lists are built dynamically by creating nodes, storing the desired data in the nodes, and then linking the nodes together

Linked lists (cont.)  Note how the nodes are linked together – this is a linked list  Conceptually, a node looks like this

Linked lists (cont.)  What does a node look like in code? class Node { private: // data type depends on what you //want to store in your list int data; // link to next node Node* next; };

Linked lists (cont.)  This picture looks like a bunch of nodes – where is the list?  The linked list is just the algorithms that are used to add, retrieve, update, and delete the nodes, plus some tracking sentinels that keep track of where the first node is – see Start above?