Introduction. 2COMPSCI 107 - Computer Science Fundamentals.

Slides:



Advertisements
Similar presentations
Programming Paradigms and languages
Advertisements

1 CS101 Introduction to Computing Lecture 17 Algorithms II.
Introduction to Programming Lesson 1. Objectives Skills/ConceptsMTA Exam Objectives Understanding Computer Programming Understand computer storage and.
Chapter 10 Introduction to Arrays
1 CENG 707 Data Structures and Algorithms Nihan Kesim Çiçekli Department of Computer Engineering Middle East Technical University Fall 2010.
Visual Basic: An Object Oriented Approach 3 – Making Objects Work.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
The Design and Analysis of Algorithms
Important Problem Types and Fundamental Data Structures
DATA STRUCTURE Subject Code -14B11CI211.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Group practice in problem design and problem solving
Data Structures Introduction Phil Tayco Slide version 1.0 Jan 26, 2015.
Python quick start guide
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Lecture 2 - Variables, program execution, calculations, print() COMPSCI 101 Principles of Programming.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
Fundamentals of Python: From First Programs Through Data Structures Chapter 14 Linear Collections: Stacks.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Summary and Exam COMP 102.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Introduction COMPSCI 105 SS 2015 Principles of Computer Science.
CSCA48 Course Summary.
ITEC 2620A Introduction to Data Structures
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 1.
Chapter 12 Recursion, Complexity, and Searching and Sorting
Computer Science Department Data Structure & Algorithms Lecture 8 Recursion.
CompSci Today’s topics Java Review Just a bunch of headings meant to trigger questions A contraction of previous notes Upcoming Midterm Exam Reading.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Classes 1 COMPSCI 105 S Principles of Computer Science.
How to Read Code Benfeard Williams 6/11/2015 Susie’s lecture notes are in the presenter’s notes, below the slides Disclaimer: Susie may have made errors.
CSC 212 – Data Structures Lecture 37: Course Review.
COMP 171: Data Types John Barr. Review - What is Computer Science? Problem Solving  Recognizing Patterns  If you can find a pattern in the way you solve.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
9/14/2015BCHB Edwards Introduction to Python BCHB Lecture 4.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
Lecture 04 – Models of memory Mutable and immutable data.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
April 27, 2017 COSC Data Structures I Review & Final Exam
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Data Structure and Algorithms
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
Progression in KS3/4 Algorithms MONDAY 30 TH NOVEMBER SUE SENTANCE.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Introduction to Programming
CSC 321: Data Structures Fall 2017
COP 3503 FALL 2012 Shayan Javed Lecture 15
CMSC201 Computer Science I for Majors Lecture 22 – Searching
COMPSCI 107 Computer Science Fundamentals
GC211Data Structure Lecture2 Sara Alhajjam.
Introduction To Flowcharting
Lecture 2 of Computer Science II
Coding Concepts (Basics)
3. Decision Structures Rocky K. C. Chang 19 September 2018
Introduction to Programming
ITEC 2620M Introduction to Data Structures
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Introduction to Data Structure
CSC 321: Data Structures Fall 2018
COP3530- Data Structures Introduction
Introduction to Programming
Introduction to Programming
COMPUTING.
Presentation transcript:

Introduction

2COMPSCI Computer Science Fundamentals

3

4

 ACM Special Interest Group in Computer Science Education 5COMPSCI Computer Science Fundamentals

6

7 Welcome to COMPSCI 107

 An efficient way to teach – not an effective way to learn  Research on learning:  Actively doing something is effective  Learning from peers is effective  Critically evaluating your own performance is essential 8COMPSCI Computer Science Fundamentals

What is effective?  Actively doing something (bring laptop to class if possible)  Critically evaluating yourselves  Learning from peers 9COMPSCI Computer Science Fundamentals

 Laboratories every week (starting week 2) ………25%  Exercises during labs  Exercises after labs(homework)  Mid-semester Test ……………………………………………15%  1 st May 205, in class, during normal lecture time  Final Exam ………………………………………………………..60%  Date to be announced 10COMPSCI Computer Science Fundamentals

 Computer feedback  Errors, testing, debugging  Automated marking  CodeRunner – automated testing  Laboratory feedback  Demonstrators  Group code review 11COMPSCI Computer Science Fundamentals

 Lectures  Overheads and recordings  Forum  Question and answers – peers, tutors and lecturers  Textbook  Problem Solving with Algorithms and Data Structures  Online, free, open source  Additional resources  Python.org  PythonTutor.com 12COMPSCI Computer Science Fundamentals

Making informed choices about programming  Building mental models of data storage and control flow  Understanding the trade-offs Focus on ways of storing and manipulating data  Different ways of structuring data storage  Efficiency  Searching  Sorting Some new programming ideas  Recursion  Exceptions 13COMPSCI Computer Science Fundamentals

 Programs consist of one or more instructions  Instructions are executed in a sequence 14COMPSCI Computer Science Fundamentals

 A simple storage box  name of the box is the identifier  stores only one thing at a time  Information in a variable has a type  boolean, integer, float, string  you can perform different operations on different types of data  Values are stored in variables using an assignment statement 15COMPSCI Computer Science Fundamentals 25 age name = "Andrew" age = 25

 Conditional statements  Change the flow of control  Conditions must evaluate to true or false (boolean)  Execute additional statements if condition is true  Used to make decisions 16COMPSCI Computer Science Fundamentals discount = 0.0 age = int(input("Enter your age: ")) if age >= 65: discount = 0.10 print("You get a discount of {:.0%}".format(discount)) price = 35 * (1.0 - discount) print("Your tickets cost: ${:.2f}".format(price))

 Loops  Change the flow of control  Execute a set of statements multiple times  Branch when the condition is false  Similar to a conditional  but repeats the statements  Python hides some of the details 17COMPSCI Computer Science Fundamentals tables = int(input("Enter the times tables: ")) print("===============") for i in range(1, 11): print("{} x {} = {}".format(i, tables, i * tables)) print("===============")

 Functions (procedures, methods, subroutines) are a way to group statements together as a unit  An identifier is used to label the function (function name)  Parameters make the code more general  Code can return a value 18COMPSCI Computer Science Fundamentals def rectangle_area(width, height): area = width * height return area function namefunction parameters return value

 Arrays  Python hides these, but they are fundamentally important  Single variable name refers to a sequence of variables  Integer values used as an "index" to specify which variable in the sequence is required  Position of the information in memory can be calculated using formula: 19COMPSCI Computer Science Fundamentals location = location_of_position_0 + index * memory_size_of_each_element my_list = ["w", "p", "c", "g", "x", "a"] print(my_list[0]) print(my_list[3])

 Object oriented programming  Defining a class (type)  Group data and code operating on that data Modular, reusable  Separate interface from implementation 20COMPSCI Computer Science Fundamentals class coordinates: #Note, coordinates are (x, y) integer values on cartesian plane def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return "({}, {})".format(self.x, self.y)

 Testing code  Use unit tests  Check output of functions with a variety of input values  Automate the testing process as much as possible  Defensive programming  Anticipate incorrect data and handle the problem without causing runtime errors  Runtime errors  Exception handling system 21COMPSCI Computer Science Fundamentals

 Used to compare different ways of working with data  Interested in scalability – how does time increase with data increase?  Write a formula that describes how much time it takes to execute a program in terms of the number of data elements 22COMPSCI Computer Science Fundamentals

 List with constrained access to data  Stack adds and removes from the same end of the list  Queue adds to one end and removes from the other end  Stack  Last In, First Out  Queue  First in, First out 23COMPSCI Computer Science Fundamentals

 Array-based lists  Singly linked lists  Doubly linked lists 24COMPSCI Computer Science Fundamentals

 Programming technique allowing problem solving 25COMPSCI Computer Science Fundamentals def fib(n): if n == 0 or n == 1: return n if n >= 2: return fib(n - 1) + fib(n - 2)

 Storing (key, value) pairs efficiently  Take any key and convert into a number between 0 and N - 1  Use an array of size N to store the value  Deal with conflicts in a consistent way  Very fast storage and access  BUT – not appropriate for ordered data 26COMPSCI Computer Science Fundamentals Each key converted into an index value

 Linear search  Look at each element  Works with any kind of data  Binary search  Halve the search space each time  Works with ordered data 27COMPSCI Computer Science Fundamentals

 Different sorting algorithms have different trade-offs  Overall efficiency  Number of comparisons  Number of swaps  Nature of the data (sorted, unsorted)  Stability 28COMPSCI Computer Science Fundamentals

 Recursive data storage  Each node has links to other nodes 29COMPSCI Computer Science Fundamentals

 Storing ordered data 30COMPSCI Computer Science Fundamentals Heap Binary Search Tree

 Pattern matching text data 31COMPSCI Computer Science Fundamentals

 Introduction to structured programming using Python  Focus on ways of storing and manipulating data  data structures  algorithms  Understanding tradeoffs 32COMPSCI Computer Science Fundamentals