Browse Course Material
Course info.
- Prof. John Guttag
![](http://academichelp.site/777/templates/cheerup/res/banner1.gif)
Departments
- Electrical Engineering and Computer Science
As Taught In
- Computer Science
Introduction to Computer Science and Programming
Lecture 3: problem solving.
- Download video
- Download transcript
![problem solving and programming ppt facebook](https://ocw.mit.edu/static_shared/images/Facebook.f4c9d732fd0e8bae1e01.png)
You are leaving MIT OpenCourseWare
![SlidePlayer SlidePlayer](https://slideplayer.com/static/blue_design/img/logo_slideplayer.png)
- My presentations
Auth with social network:
Download presentation
We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Chapter 2: Problem Solving
Published by Arron Leonard Modified over 9 years ago
Similar presentations
Presentation on theme: "Chapter 2: Problem Solving"— Presentation transcript:
![In this chapter you will learn about: Introduction to Problem Solving. Software development method (SDM) Specification of needs. Problem analysis. Design and algorithmic representation. Implementation. Testing and verification. Documentation. Principles of Programming - NI July Chapter 2: Problem Solving](https://slideplayer.com/slide/4273293/14/images/1/Chapter+2%3A+Problem+Solving.jpg)
CS101: Introduction to Computer programming
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/17/3378996/big_thumb.jpg)
1 CS101 Introduction to Computing Lecture 17 Algorithms II.
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/13/4010394/big_thumb.jpg)
Chapter 1 - An Introduction to Computers and Problem Solving
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/14/4273535/big_thumb.jpg)
Reference :Understanding Computers
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/14/4273594/big_thumb.jpg)
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/14/4273774/big_thumb.jpg)
Fundamentals of Algorithms MCS - 2 Lecture # 4
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/15/4597107/big_thumb.jpg)
ITEC113 Algorithms and Programming Techniques
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/17/5382863/big_thumb.jpg)
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/17/5384812/big_thumb.jpg)
Chapter 3 Planning Your Solution
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/6/5663503/big_thumb.jpg)
The Program Design Phases
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/18/5705359/big_thumb.jpg)
PRE-PROGRAMMING PHASE
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/19/5914110/big_thumb.jpg)
Fundamentals of C programming
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/20/6062601/big_thumb.jpg)
ALGORITHMS AND FLOWCHARTS
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/21/6267330/big_thumb.jpg)
DCT 1123 Problem Solving & Algorithms
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/23/6539540/big_thumb.jpg)
CSEB114: PRINCIPLE OF PROGRAMMING Chapter 2: Problem Solving.
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/23/6539589/big_thumb.jpg)
Programming Techniques I SCJ1013
![problem solving and programming ppt problem solving and programming ppt](https://slideplayer.com/23/6632551/big_thumb.jpg)
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
About project
© 2024 SlidePlayer.com Inc. All rights reserved.
- Computer Science and Engineering
- Introduction to Problem Solving and Programming (Video)
- Co-ordinated by : IIT Kanpur
- Available from : 2009-12-31
- Watch on YouTube
- Assignments
- Transcripts
Sl.No | Chapter Name | English |
---|---|---|
1 | Lecture 1 | PDF unavailable |
2 | Lecture 2 | PDF unavailable |
3 | Lecture 3 | PDF unavailable |
4 | Lecture 4 | PDF unavailable |
5 | Lecture 5 | PDF unavailable |
6 | Lecture 6 | PDF unavailable |
7 | Lecture 7 | PDF unavailable |
8 | Lecture 8 | PDF unavailable |
9 | Lecture 9 | PDF unavailable |
10 | Lecture 10 | PDF unavailable |
11 | Lecture 11 | PDF unavailable |
12 | lecture 12 | PDF unavailable |
13 | Lecture 13 | PDF unavailable |
14 | Lecture 14 | PDF unavailable |
15 | Lecture 15 | PDF unavailable |
16 | Lecture 16 | PDF unavailable |
17 | Lecture 17 | PDF unavailable |
18 | Lecture 18 | PDF unavailable |
19 | Lecture 19 | PDF unavailable |
20 | Lecture 20 | PDF unavailable |
21 | Lecture 21 | PDF unavailable |
22 | Lecture 21 | PDF unavailable |
23 | Lecture 23 | PDF unavailable |
24 | Lecture 24 | PDF unavailable |
Sl.No | Language | Book link |
---|---|---|
1 | English | Not Available |
2 | Bengali | Not Available |
3 | Gujarati | Not Available |
4 | Hindi | Not Available |
5 | Kannada | Not Available |
6 | Malayalam | Not Available |
7 | Marathi | Not Available |
8 | Tamil | Not Available |
9 | Telugu | Not Available |
![problem solving and programming ppt PowerShow.com - The best place to view and share online presentations](https://www.powershow.com/themes/default/images/PowerShow.com_logo.jpg)
- Preferences
![problem solving and programming ppt Free template](https://www.powershow.com/themes/default/images/ps_header_ad.png)
Introduction to Computers, Problem Solving, and Programming - PowerPoint PPT Presentation
![problem solving and programming ppt problem solving and programming ppt](https://s3.amazonaws.com/images.powershow.com/4004106.pr.jpg)
Introduction to Computers, Problem Solving, and Programming
Introduction to computers, problem solving, and programming chapter 1 1.1 overview of computers computer - a device for counting or computing dr. john atanasoff ... – powerpoint ppt presentation.
- Computer - A device for counting or computing
- Dr. John Atanasoff - 1st computer.
- ENIAC 1946 at U of Penn
- Dr. John Von Neumann - Princeton
- Stored program concept
- Memory rather than wires and switches.
- Computing History
- Von Neumann architecture basis for today's computers
- VLSI Technology made computers affordable, small and available to the public
- How programming has changed over time
- Every computer is organized roughly into six parts
- CPU - central processing unit
- Where decisions are made, computations are performed, and input/output requests are delegated
- Main Memory
- Stores information being processed by the CPU
- Secondary Memory
- Stores data and programs
- Input devices
- Allows people to supply information to computers
- Output devices
- Allows people to receive information from computers
- Network connection
- Modems / Ethernet interface
- Semi permanent data-storage capability
- Tape or Disk
- Secondary memory has much more storage capacity
- Brains of the computer
- Arithmetic calculations are performed using the Arithmetic/Logical Unit or ALU
- Control unit decodes and executes instructions
- Arithmetic operations are performed using binary number system
- Fundamental building block is a switch
- Switches are made from ultrasmall transistors
- The Pentium processor contains about three million transistors
- The Pentium Pro has about 5.5 million transistors
- Accessories that allow computer to perform specific tasks
- Receiving information for processing
- Return the results of processing
- Store information
- Common input and output devices
- Printer Joystick CD-ROM
- Keyboard Monitor
- LAN - Local area network
- Organizational
- WAN - Wide area network
- Introduced 1989
- Developed by CERN
- European Laboratory for Particle Physics
- Web browser
- Application software
- Programs designed to perform specific tasks that are transparent to the user
- System software
- Programs that support the execution and development of other programs
- Two major types
- Operating systems
- Translation systems
- Application software is the software that has made using computers indispensable and popular
- Common application software
- Word processors
- Desktop publishing programs
- Spreadsheets
- Presentation managers
- Drawing programs
- Controls and manages the computing resources
- Important services that an operating system provides
- File system
- Commands that allow for manipulation of the file system
- Ability to perform input and output on a variety of devices
- Management of the running systems
- MSDOS , Windows , Unix
- Machine Language
- Native tongue of the computer
- Binary 0s and 1s that specify what to do
- 0010 0000 0000 0100
- 1000 0000 0000 0101
- 0011 0000 0000 0110
- High - Level Languages
- Resemble human language (C, C, Pascal)
- cost price tax
- Language Standard
- Syntax (grammatical form) (rules)
- programs used without modification
- Source Program
- Object Program
- Executable Program
- OOP derived from C
- Bjarne Stroustrup
- Popular because of reuse
- Organized in a Hierarchy
- Super Classes
- Sub Classes
- Object-oriented design and programming supports good software engineering
- Object-oriented design promotes thinking about software in a way that models the real world
- Algorithms are the basis for the procedural sections (Structured Programs)
- Highly structured
- Top-down design
- Step-wise refinement
- Abstraction
- Extract the relevant properties of an object while ignoring inessential details
- Encapsulation
- Breaking down an object into parts, hiding and protecting its essential information, and supplying an interface to modify the information in a controlled and useful manner
- Dividing an object into smaller pieces or modules such that the object is easier to understand and manipulate
- Ranking or ordering of objects based on some relationship between them
- Process of extracting only the relevant properties of an object
- Extracted properties define a view of the object
- Car dealer views a car from selling features standpoint
- Price, warranty, color, etc.
- Mechanic views a car from systems maintenance standpoint
- Oil, oil filter, spark plugs, etc.
- By hiding the information its representation and content can be changed without affecting other parts of the system
- Example - car radio
- Controlled by switches and knobs
- The details of how it works is hidden
- Dividing an object so that the object holds useful information and it is easier to understand
- Most complex systems are modular
- Cooling System
- Ignition System
- Fuel System
- Example - Automobile can be decomposed into subsystems
- Cooling system
- Ignition system
- Spark plugs
- Hierarchies facilitate understanding complex organizations and systems
- Example - a company hierarchy helps employees understand the structure of their company and their positions
- Later we will use data abstractions
- Will apply OO techniques
- Structured Programming
- Object Oriented Programming
- Model our own objects or abstractions
- Set of programs used to develop software
- A key component of a is a translator
- Types of translators
- g, Borland C , Microsoft Visual C
- Editor used to enter the program
- Source program (file.cpp)
- UNIX vi text editor
- Compiler translates the source program
- Displays syntax errors (not descriptive)
- Linker/Loader to combine object file with other object files
- Executable program
- Major activities
- Linking with pre-compiled files
- Object files
- Library modules
- Loading and executing
- Viewing the behavior of the program
- Problem Analysis - (Correct Problem)
- Identify data objects
- Goal to model properties
- Determine Input / Output data
- Constraints on the problem
- Decompose into smaller problems
- Top-down design (divide and conquer)
- Develop Algorithm (Desk check)
- Implementation
- Writing the algorithm
- Verify the program meets requirements
- System and Unit test
- Documentation
- Key part in the development process
- Software engineering
- Area of computer science concerned with building large software systems
- Tremendous advances in hardware have not been accompanied by comparable advances in software
- Reliability
- An unreliable life-critical system can be fatal
- Understandability
- Future development becomes very difficult if software is hard to understand
- Cost Effectiveness
- Cost to develop and maintain should not exceed profit
- Adaptability
- System that is adaptive is easier to alter and expand
- Reusability
- Improves reliability and maintainability, and reduces development costs
- Case Study Converting Miles to Kilometers
- Problem Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion.
- Analysis The first step in solving this problem is to determine what you are asked to do. You must convert from one system of measurement to another, but are you supposed to convert from kilometers to miles, or vice versa? The problem states that you prefer to deal in metric measurements, so you must convert distance measurements in miles to kilometers.
- Design The next step is to formulate the algorithm that solves the problem. Begin by listing the three major steps, or sub problems, of the algorithm.
- Implementation To implement the solution, you must write the algorithm as a C program.
- Testing How do you know the sample run is correct?
- Privacy and Misuse of Data
- Computer Hacking
- Plagiarism and Software Piracy
- Misuse of a Computer Resource
PowerShow.com is a leading presentation sharing website. It has millions of presentations already uploaded and available with 1,000s more being uploaded by its users every day. Whatever your area of interest, here you’ll be able to find and view presentations you’ll love and possibly download. And, best of all, it is completely free and easy to use.
You might even have a presentation you’d like to share with others. If so, just upload it to PowerShow.com. We’ll convert it to an HTML5 slideshow that includes all the media types you’ve already added: audio, video, music, pictures, animations and transition effects. Then you can share it with your target audience as well as PowerShow.com’s millions of monthly visitors. And, again, it’s all free.
About the Developers
PowerShow.com is brought to you by CrystalGraphics , the award-winning developer and market-leading publisher of rich-media enhancement products for presentations. Our product offerings include millions of PowerPoint templates, diagrams, animated 3D characters and more.
![problem solving and programming ppt World's Best PowerPoint Templates PowerPoint PPT Presentation](https://s3.amazonaws.com/images.powershow.com/3672452.th0.jpg?_=20220120082)
![problem solving and programming ppt itb001 problem solving and programming lecture 8](https://cdn3.slideserve.com/5552657/itb001-problem-solving-and-programming-lecture-8-n.jpg)
ITB001 Problem Solving and Programming Lecture 8
Mar 17, 2019
750 likes | 871 Views
ITB001 Problem Solving and Programming Lecture 8. Faculty of Information Technology Queensland University of Technology. Aims of this lecture. This lecture further illustrates the notion of data abstraction with three important examples, tables , trees and tagged data
Share Presentation
- data structure
- data representation
- data abstraction
- list chico 1
- list list chico 1
![problem solving and programming ppt stu](https://www.slideserve.com/photo/30197.jpeg)
Presentation Transcript
ITB001Problem Solving and ProgrammingLecture 8 Faculty of Information Technology Queensland University of Technology
Aims of this lecture • This lecture further illustrates the notion of data abstraction with three important examples, tables, trees and tagged data • Tables introduce some of the basic operations needed to maintain databases • Trees are a commonly-used recursive data structure for sorting data • Tagged data items allow different representations of data values to coexist
References • Concrete Abstractions: An Introduction to Computer Science Using Scheme, page 532 and Sections 8.1, 8.2 and 9.3 • Structure and Interpretation of Computer Programs, Sections 2.2.2, 2.3.3 and 2.4.2
Data abstractioncase study 1: Tables
The notion of tables • The idea of a table of values is a familiar way of associating a ‘key’ with a particular value • For example, the following table associates names (the keys) with heights (in metres)
The notion of tables • Given such a table we can look up the values to discover, for instance, that Harpo’s height is 1.62m • However, we cannot use this table to learn Zeppo’s height because key ‘Zeppo’ does not appear in the table • The particular table shown above is unsorted, although we could choose to order the table by key
A simple data representation for tables • An easy way to represent a table is as an association list, i.e., a list of key-value pairs • An advantage of using lists is that we can easily increase the size of the table • Association lists are not a very efficient data structure for large databases, but are suitable for maintaining small tables
A simple data representation for tables • For example, the table of heights above could be represented in Scheme as the following nested list of strings and numbers: • (list (list "Groucho" 1.57) • (list "Harpo" 1.62) • (list "Chico" 1.61)) • However, as usual, we don’t want users of tables to be aware of this underlying data representation • Preventing this allows us to change the represent-ation to a more efficient one such as a ‘hash table’
Exercise 8-1: Some basicoperations on tables • Define the following procedures for tables, using association lists as the data representation • (make-table) is a parameterless constructor that returns an empty table • (add-to-table kvt) is an operation that returns table t with a new association between key k and value v (overriding any previous association) • (lookup-table kt) is a selector that returns the value in table t associated with key k, or returns string "ERROR" if there is no such key in the table
Exercise 8-1: Some basicoperations on tables • Example: • (define heights • (add-to-table "Chico" 1.61 • (add-to-table "Harpo" 1.62 • (add-to-table "Groucho" 1.57 • (make-table))))) • (lookup-table "Harpo" heights) returns 1.62 • (lookup-table "Zeppo" heights) returns "ERROR"
Exercise 8-1: Some basicoperations on tables • Example: • (define heights • (add-to-table "Zeppo" 1.59 heights)) • (lookup-table "Zeppo" heights) returns 1.59 • (define heights • (add-to-table "Harpo" 1.58 heights)) • (lookup-table "Harpo" heights) returns 1.58
Exercise 8-2: Removingassociations from a table • So far we have been able to make our tables grow larger only • Define a procedure (remove-from-table kt) which returns table t with any association for key k removed • If key k did not appear in table t then remove-from-table should just return table t unchanged • If key k appears more than once in table t then all such associations should be removed
Exercise 8-2: Removingassociations from a table • Example: • (define heights • (add-to-table "Chico" 1.61 • (add-to-table "Harpo" 1.62 • (add-to-table "Groucho" 1.57 • (make-table))))) • (lookup-table "Harpo" heights) returns 1.62
Exercise 8-2: Removingassociations from a table • (define heights • (remove-from-table "Harpo" heights)) • (lookup-table "Harpo" heights) returns "ERROR"
Exercise 8-3: Maintaining a sorted table • For efficient searching we may want to keep entries in the table sorted by key • We can do this by defining a version of procedure add-to-table that always puts associations in the right place • However, to know what the ‘right’ place is we need to know what criterion is used to sort keys • Define a new procedure (add-to-table kvpt) which accepts a predicate p that can be applied to two keys to determine their order
Exercise 8-3: Maintaining a sorted table • Procedure add-to-table should add the new association to the table in a position such that the key of the preceding association (if any) is ‘less than’ key k, according to predicate p, and the key of the succeeding association (if any) is ‘greater than’ key k, according to predicate p • If table t already contained an association for key k the old association should be removed from the table • You can assume that table t is already sorted and that key k occurs at most once in table t
Exercise 8-3: Maintaining a sorted table • Example: • (add-to-table "Chico" 1.61 string<? • (add-to-table "Harpo" 1.62 string<? • (add-to-table "Groucho" 1.57 string<? • (make-table)))) • orders associations by predicate string<? and represents the table as • (list (list "Chico" 1.61) • (list "Groucho" 1.57) • (list "Harpo" 1.62))
Exercise 8-3: Maintaining a sorted table • Comment: To explain the example above we broke the data abstraction barrier for tables • A user of tables should not directly examine (or even care about) their representation
Data abstraction barriersin the tables case study • With these operations on tables in place it is now possible to use tables without even knowing that they are implemented using association lists • This would allow us to change the representation of tables, or otherwise modify the operations on them, without affecting users of tables
Data abstraction barriersin the tables case study Programs that use tables Tables in the problem domain lookup-table add-to-table … Tables as association lists cons first rest … Scheme’s implementation of lists
Data abstraction casestudy 2: Binary trees
The importance of trees • Trees are one of the most important data structures in computing and are used to solve a wide variety of data structuring, sorting and searching problems • Like lists, they are an example of a recursively-defined data structure • Indeed, we will build our data abstraction for trees on top of that for lists
An obvious example of a tree is the directory structure of your computer Each folder is the root of a tree with branches containing other folders and files Each file is a leaf that ends a branch A common example A B 1 2 3 C D 4 5
A conventional notation • Traditionally, trees are drawn as directed graphs which ‘grow’ downwards • Thus the root is at the top and the leaves are at the bottom A C B 1 2 3 D 5 4
Binary trees • In general a node within a tree may have any number of branches • In the preceding example node B had three branches • However, an important special case is that of binary trees whose nodes have at most two branches • Binary trees are commonly used for storing values in a particular order so that they can be retrieved quickly
An ordered binary tree is one in which, for all nodes, all values in its left-hand branch are ‘less than’ the root value and all values in its right-hand branch are ‘greater than’ the root value The tree on the right is ordered by the ‘<’ relationship for numbers Ordered binary trees 4 2 5 1 3
A data structure forrepresenting binary trees • In Scheme we can represent trees easily using nested lists • Each node in the tree can be represented as a list of length three, containing the node’s value and the left and right branches • If the tree is a leaf then both the branches will be the empty tree • The empty tree can be represented by the empty list
A data structure forrepresenting binary trees • Example: The following list represents the ordered binary tree shown on the right • (list 4 • (list 2 • (list 1 empty empty) • (list 3 empty empty)) • (list 5 empty empty)) 4 2 5 1 3
A data structure forrepresenting binary trees • Example: The following binary tree is unordered • (list 7 • (list 9 • (list 6 empty empty) • (list 3 • (list 4 empty empty) • empty))) • (list 0 • (list 8 • empty • (list 2 empty empty)) • (list 5 empty empty))) 7 9 0 3 8 5 6 4 2
A data abstraction for binary trees • However, representing trees using lists in this way exposes the underlying data structure • Instead, we should define meaningful constructors, selectors and other operations on binary trees that hide the way we have chosen to implement trees • We can represent the empty tree by a special value: (define stump empty)
A data abstraction for binary trees • The following two constructors are convenient for creating a tree with two branches and a tree with no branches, respectively: (define [root root-value left-branch right-branch] (list root-value left-branch right-branch)) (define [leaf leaf-value] (root leaf-value stump stump))
A data abstraction for binary trees • The following three selectors for extracting parts of a given tree are defined easily as synonyms of the corresponding list operations: (define root-value first) (define left-branch second) (define right-branch third)
A data abstraction for binary trees • The following two predicates are helpful when traversing trees: (define stump? empty?) (define [leaf? tree] (and (not (stump? tree)) (stump? (left-branch tree)) (stump? (right-branch tree)))
A data abstraction for binary trees • Using these constructors we can define a binary tree in a more readable way: • (root 4 • (root 2 • (leaf 1) • (leaf 3)) • (leaf 5)) 4 2 5 1 3
A data abstraction for binary trees • Similarly in this more complicated case: • (root 7 • (root 9 • (leaf 6) • (root 3 • (leaf 4) • stump))) • (root 0 • (root 8 • stump • (leaf 2)) • (leaf 5))) 7 9 0 3 8 5 6 4 2
Counting leaves • Given this representation we can easily write a recursive procedure for counting the leaves in a tree: (define [count-leaves tree] (cond [(stump? tree) 0] [(leaf? tree) 1] [else ; node is the root of a sub-tree (+ (count-leaves (left-branch tree)) (count-leaves (right-branch tree)))] ))
Counting leaves • Procedure count-leaves has two base cases: • One for a leaf • One for an empty tree (‘stump’) • It also makes two recursive references to itself: • One for the left branch of a sub-tree • One for the right branch of a sub-tree
The computational processfor counting leaves (count-leaves (root 9 (root 5 (leaf 8) stump) (root 3 (leaf 2) (leaf 4)))) = (+ (+ 1 0) (+ 1 1)) = 3 (+ 9 (+ 5 (+ 3 0) 8 2 4 1 1 1))
Exercise 8-4: Depth of a binary tree • We define the ‘depth’ of a tree as the length of the longest path from the root to a leaf • In the case of sorted trees, this tells us how many steps will be required to find an item in the worst case • Define a procedure tree-depth which returns the maximum depth of a given binary tree
Exercise 8-4: Depth of a binary tree • Examples: • (tree-depth stump) returns 0 • (tree-depth (leaf 8)) returns 1 • (tree-depth (root 9 • (root 5 • (leaf 2) • (leaf 6)) • (leaf 4))) returns 3
Exercise 8-4: Depth of a binary tree • (tree-depth (root "a" • (leaf "z") • stump)) returns 2
Exercise 8-5: Binary tree predicate • We have seen that Scheme provides numerous predicates for checking to see what the type of a given value is, e.g., number?, list?, string?, etc • Having introduced a notion of binary trees we should similarly define a predicate for checking to see whether a given data structure is a properly-formed tree • In addition, we will check that the tree is homogeneous in the sense that all of its leaves are of the same type
Exercise 8-5: Binary tree predicate • Define a higher-order procedure check-tree which accepts a type predicate (such as number?, string?, etc) • Procedure check-tree should return a predicate (a Boolean-valued procedure) which accepts a data structure and returns #t (logical true) only if the structure is a well-formed binary tree and all the leaves are of the right type
Exercise 8-5: Binary tree predicate • Example: • (define tree-of-strings? • (check-tree string?)) returns a procedure which tests to see if a given data structure is a binary tree containing only strings • (tree-of-strings? • (root "a" • (leaf "b") • (root "c" stump • (leaf "d")))) returns #t
Exercise 8-5: Binary tree predicate • (tree-of-strings? • (root 1 (leaf 2) • (leaf 3))) returns #f because the values in the tree are not strings • (tree-of-strings? • (list "a" • (list "b") • (list empty (list "c")))) returns #f because the data structure is not a properly-formed binary tree
Manipulating the values in a tree • Given a tree of numbers, the following procedure multiplies all the values by a given factor: (define [scale-tree numbers factor] (if (stump? numbers) stump (root (* factor (root-value numbers)) (scale-tree (left-branch numbers) factor) (scale-tree (right-branch numbers) factor))))
Manipulating the leaves of a tree • Example: • (scale-tree • (root 4 (root 2 (leaf 1) (leaf 3)) • (leaf 5)) • 10) • returns • (root 40 (root 20 (leaf 10) (leaf 30)) • (leaf 50)) • Thought exercise: Why didn’t procedure scale-tree need to treat leaves as a special case?
Cloning trees • Like count-leaves, the scale-tree procedure ‘walks’ through the given tree by following the branches • However, rather than returning a single value, it returns a whole tree • Importantly, the tree that is returned is built with tree constructor root and special value stump • The returned tree is not the same tree provided as an argument to procedure scale-tree • It is a new tree with the same ‘shape’ as the original one
Exercise 8-6: Largest number in a tree • Define a procedure tree-max which returns the largest value in a (not necessarily sorted) binary tree of non-negative numbers (or 1 if the tree is just a stump) • Examples: • (tree-max stump) returns -1 • (tree-max • (root 6 • (root 7 (leaf 1) (leaf 8)) • (leaf 2))) returns 8
Exercise 8-6: Largest number in a tree • (tree-max • (root 4 • (root 8 • (root 5 (leaf 7) stump) • (leaf 2)) • (root 5 (leaf 9) stump))) • returns 9
- More by User
![problem solving and programming ppt Introduction to Programming and Problem Solving](https://cdn0.slideserve.com/538089/cis-115-lecture-1-dt.jpg)
Introduction to Programming and Problem Solving
CIS 115 Lecture 1. Introduction to Programming and Problem Solving. Parts of a Computer System:. Hardware: Electronic Devices Software: Instructions and Computer Programs. Hardware. Input : Keyboard, Mouse System unit: Random Access Memory (RAM) Central Processing Unit (CPU)
3.87k views • 35 slides
![problem solving and programming ppt Problem solving vs. programming](https://cdn0.slideserve.com/642237/problem-solving-vs-programming-dt.jpg)
Problem solving vs. programming
Problem solving vs. programming. Problem solving vs. algorithm development vs. programming. Problem Solving. understand and define the problem what is it that needs to be solved Identify an approach the basic equations, relations, etc Develop and specify an algorithm
582 views • 47 slides
![problem solving and programming ppt Computer Programming and Problem Solving Input](https://cdn4.slideserve.com/734813/slide1-dt.jpg)
Computer Programming and Problem Solving Input
Input/Output and Plotting Basics. Material from Chapter 2.6-2.7 and 2.11Input deals with things a user tells the computerOutput deals with things the computer tells the user. Keyboard Input. MATLAB allows you to prompt" for input interactivelyThis is through the input function:input(prompt_
399 views • 22 slides
![problem solving and programming ppt CITS1401 Problem Solving and Programming](https://cdn1.slideserve.com/1592624/cits1401-problem-solving-and-programming-dt.jpg)
CITS1401 Problem Solving and Programming
CITS1401 Problem Solving and Programming. Semester 1, 2013 A/Prof Lyndon While School of Computer Science & Software Engineering The University of Western Australia. Introduction and Admin. Objectives. CITS1401 covers
425 views • 16 slides
![problem solving and programming ppt CITS1401 Problem Solving and Programming](https://cdn1.slideserve.com/1990424/cits1401-problem-solving-and-programming-dt.jpg)
CITS1401 Problem Solving and Programming. Semester 1, 2014 A/Prof Lyndon While School of Computer Science & Software Engineering The University of Western Australia. Problem-solving Techniques. CITS1401. CITS1401 covers
505 views • 33 slides
![problem solving and programming ppt Computational Thinking, Problem-Solving and Programming](https://cdn1.slideserve.com/2233013/topic-4-dt.jpg)
Computational Thinking, Problem-Solving and Programming
Topic 4. Computational Thinking, Problem-Solving and Programming. Assessment Objectives. Assessment objective 1 : classify, define, draw, label, list, state Assessment objective 2 : annotate, apply, calculate, describe, design, distinguish, estimate, identify, outline , present, trace
896 views • 27 slides
![problem solving and programming ppt CITS1401 Problem Solving and Programming](https://cdn1.slideserve.com/2689518/cits1401-problem-solving-and-programming-dt.jpg)
CITS1401 Problem Solving and Programming. Semester 1, 2013 A/Prof Lyndon While School of Computer Science & Software Engineering The University of Western Australia. Problem-solving Techniques. CITS1401. CITS1401 covers
453 views • 33 slides
![problem solving and programming ppt CITS1401 Problem Solving and Programming](https://cdn1.slideserve.com/2834330/cits1401-problem-solving-and-programming-dt.jpg)
CITS1401 Problem Solving and Programming. Semester 1, 2014 A/Prof Lyndon While School of Computer Science & Software Engineering The University of Western Australia. Introduction and Admin. Objectives. CITS1401 covers
315 views • 16 slides
![problem solving and programming ppt ITB001 Problem Solving and Programming Lecture 5](https://cdn1.slideserve.com/3580402/itb001-problem-solving-and-programming-lecture-5-dt.jpg)
ITB001 Problem Solving and Programming Lecture 5
ITB001 Problem Solving and Programming Lecture 5. Faculty of Information Technology Queensland University of Technology. Aims of this lecture. Last week we saw how to break a problem down so that it can be solved by a series of repeated steps
613 views • 53 slides
![problem solving and programming ppt ITB001 Problem Solving and Programming Lecture 9](https://cdn2.slideserve.com/3629864/itb001-problem-solving-and-programming-lecture-9-dt.jpg)
ITB001 Problem Solving and Programming Lecture 9
ITB001 Problem Solving and Programming Lecture 9. Faculty of Information Technology Queensland University of Technology. Aims of this lecture. In this lecture we allow for problems whose solution requires a ‘memory’ of past events To do this we need some new programming concepts:
775 views • 64 slides
![problem solving and programming ppt CITS1401 Problem Solving and Programming](https://cdn2.slideserve.com/3890612/cits1401-problem-solving-and-programming-dt.jpg)
CITS1401 Problem Solving and Programming. Semester 1, 2012 A/Prof Lyndon While School of Computer Science & Software Engineering The University of Western Australia. Introduction and Admin. Objectives. CITS1401 covers
297 views • 16 slides
![problem solving and programming ppt Problem Solving for Programming](https://cdn2.slideserve.com/3947739/problem-solving-for-programming-dt.jpg)
Problem Solving for Programming
Problem Solving for Programming. Session 3 Dealing with Sequence, Choice and Repetition. Sequence. Consider the coffee problem from the exercises in Vickers Chapter 3.
400 views • 26 slides
![problem solving and programming ppt Computer Programming and Problem Solving](https://cdn2.slideserve.com/4280426/computer-programming-and-problem-solving-dt.jpg)
Computer Programming and Problem Solving
Computer Programming and Problem Solving. Ke shuwei. What is the meaning of problem solve? How to solve it? What is computer programming? What is basic knowledge for solving?. Computer Problem. the problem about computer itself Blue Screen of Death (BSoD). Computer Problem.
801 views • 53 slides
![problem solving and programming ppt MT258 Computer Programming and Problem Solving](https://cdn2.slideserve.com/4550026/mt258-computer-programming-and-problem-solving-dt.jpg)
MT258 Computer Programming and Problem Solving
MT258 Computer Programming and Problem Solving. Unit 1. Important points. Method for calculating the final grade. The procedure for requesting of extensions. The procedure for handing in TMAs. Programming style. Contents. Course Outline Questions and Answers Revision of Unit 1
674 views • 54 slides
![problem solving and programming ppt Programming and Problem Solving — Software Engineering](https://cdn2.slideserve.com/4670895/slide1-dt.jpg)
Programming and Problem Solving — Software Engineering
Programming and Problem Solving — Software Engineering. (Read Chap. 2). 1. OCD (Object-Centered Design). Problem Solving. A Temperature-conversion problem : Write a program that, given a temperature in Celsius, displays that temperature in Fahrenheit.
460 views • 24 slides
![problem solving and programming ppt MT258 Computer Programming and Problem Solving](https://cdn2.slideserve.com/4699476/mt258-computer-programming-and-problem-solving-dt.jpg)
MT258 Computer Programming and Problem Solving. Unit 9. UNIT Nine From algorithms to problem solving. Stack. The stack data structure is characterized as ‘last in, first out’ or LIFO. Stack can be implemented using contiguous arrays or using linked lists with pointers. Stack.
493 views • 36 slides
![problem solving and programming ppt MT258 Computer Programming and Problem Solving](https://cdn2.slideserve.com/5184491/mt258-computer-programming-and-problem-solving-dt.jpg)
MT258 Computer Programming and Problem Solving. Unit 5. UNIT Five Abstract data and hidden code. Abstract data type (ADT). A data type is defined by its behavior more so than its representation. An abstract data type (ADT) is a set of data items and its operations. Records for typedef.
505 views • 40 slides
![problem solving and programming ppt ITB001 Problem Solving and Programming Lecture 4](https://cdn3.slideserve.com/5927447/itb001-problem-solving-and-programming-lecture-4-dt.jpg)
ITB001 Problem Solving and Programming Lecture 4
ITB001 Problem Solving and Programming Lecture 4. Faculty of Information Technology Queensland University of Technology. Aims of this lecture. Last week we saw how parameterised procedures allow us to reuse solutions
536 views • 47 slides
![problem solving and programming ppt Problem Solving for Programming](https://cdn3.slideserve.com/6859778/problem-solving-for-programming-dt.jpg)
Problem Solving for Programming. Session 4 Calculating and Keeping Track of Values. Variables. Imagine the following scenario:
303 views • 23 slides
![problem solving and programming ppt Problem Solving for Programming](https://cdn3.slideserve.com/6859781/problem-solving-for-programming-dt.jpg)
Problem Solving for Programming. Session 7 Data Types for Computer Programs. Data Types. So far we have looked at several basic data types in this module: Integer Decimal/fractional String Boolean We also looked at how variables are created and initialized: sugarsAdded 0 ;
417 views • 31 slides
![problem solving and programming ppt Programming and Problem Solving — Software Engineering](https://cdn4.slideserve.com/9122877/programming-and-problem-solving-software-engineering-dt.jpg)
248 views • 24 slides
![problem solving and programming ppt Problem Solving and Programming – Problem Solving](https://cdn5.slideserve.com/9581168/dr-scott-turner-dt.jpg)
Problem Solving and Programming – Problem Solving
Dr Scott Turner. Problem Solving and Programming – Problem Solving. Why do you needed to develop problem solving skills?. One definition of programming is it is applied problem solving You have a problem (E.g Need a program to calculate the area of the circle). What needs to be done?
703 views • 29 slides
Microsoft 365 Life Hacks > Writing > Fifteen Professional Acronyms and Abbreviations You Need to Know
Fifteen Professional Acronyms and Abbreviations You Need to Know
When you transition into a new career or profession, there is always a learning curve. Business communication is the one of the first hurdles to successfully integrate into a new work environment. Overcome communication barriers and learn professional acronyms and abbreviations you need to succeed in the workplace.
![problem solving and programming ppt A group of people laughing at a table](https://m365contenthub.wpengine.com/en-us/wp-content/uploads/2024/04/X-professional-acronyms-and-abbreviations-you-need-to-know-1600x600-1.jpg)
![](http://academichelp.site/777/templates/cheerup/res/banner1.gif)
Why Should You Know Professional Acronyms and Abbreviations
Within corporate and professional environments, certain abbreviations and acronyms are used to communicate. For a new professional, these abbreviations and acronyms can be confusing and make the initial integration more difficult. Although they can be challenging, acronyms and abbreviations can make work more efficient and speed up communication. By using professional acronyms and abbreviations effectively, it will speed up the delivery of your message and be easily comprehended by your colleagues.
![problem solving and programming ppt Get the most out of your documents with Word Banner](https://m365contenthub.wpengine.com/en-us/wp-content/uploads/2023/06/50-50-bounce-word.jpg)
Get the most out of your documents with Word
Elevate your writing and collaborate with others - anywhere, anytime
What corporate acronyms and abbreviations do you need to know?
To help you comprehend business and professional communication, add the following acronyms and abbreviations into your lexicon:
1. CEO – Chief Executive Officer
CEO stands for Chief Executive Officer, which is the highest-ranking executive at a company. They make decisions to expand the company, drive profitability, and are responsible for leading an entire organization.
2. ROI – Return on Investment
Return on Investment is a metric that measures the profitability of an investment, telling you how much profit or loss you have earned.
3. KPI – Key Performance Indicator
KPIs are metrics that showcase how well your company is performing in a certain area. They can be used internally or for clients, to demonstrate the impact of a company’s provided services.
4. CRM – Customer Relationship Management
Customer relationship management (CRM) refers to technology or processed used to manage, track, and analyze your company’s relationships with customers and potential customers.
5. OOO – Out of Office
Out of Office (OOO) is an acronym used for employees who are not in the office, whether they are sick, on leave, or taking a vacation.
6. COB – Close of Business
Close of business refers to the end of the business day, which is usually at 5PM.
7. SOP – Standard Operating Procedure
A standard operating procedure (SOP) provides established protocols and step-by-step instructions to ensure consistency and efficiency in executing routine tasks and operations.
8. API – Application Programming Interface
An application programming interface (API) is a software that serves a distinct function between different software applications, allowing seamless data exchange and integration, thereby enhancing functionality and user experience.
9. SME – Subject Matter Experts
SMEs, or subject matter experts, possess specialized knowledge and expertise, serving as invaluable resources for guidance and problem-solving.
10. SMB – Small and Medium-sized Business
SMB, or small and medium sized business, refers to companies and enterprises that are smaller in size and revenue than large corporations, but not as small as microbusinesses.
11. CTA – Call to Action
CTA prompts users to take specific actions, such as making a purchase or subscribing to a service, enhancing engagement and conversion rates in marketing campaigns.
12. B2B – Business to Business
Business to Business (B2B) transactions involve commerce conducted between businesses, encompassing sales, partnerships, and collaborations tailored to meet the needs of corporate clients.
13. B2C – Business to Consumer
B2C transactions involve direct commerce between businesses and individual consumers, encompassing retail sales and service provision to end-users.
14. Admin – Administration
Admin pertains to administrative tasks and responsibilities, encompassing a wide range of duties aimed at ensuring the smooth functioning of organizational processes.
15. HR – Human Resources
Human Resources (HR) oversees personnel management and workforce development initiatives, encompassing recruitment, training, employee relations, and policy implementation.
Learning corporate and professional acronyms and abbreviations make it easier transitioning into a professional role. You can effectively communicate and comprehend colleagues, while effectively managing time and improving operational efficiency. For more ways to improve communication in the workplace, like learning how to craft work emails and meeting agendas , learn more writing tips .
Get started with Microsoft 365
It’s the Office you know, plus the tools to help you work better together, so you can get more done—anytime, anywhere.
Topics in this article
More articles like this one.
![problem solving and programming ppt problem solving and programming ppt](https://m365contenthub.wpengine.com/wp-content/uploads/2024/06/When-to-use-while-vs-whilst-494x278-1.jpg)
When to use 'while' vs. 'whilst'
“While” and “whilst” are usually interchangeable, but not always. See how they differ and learn how to use them effectively.
![problem solving and programming ppt problem solving and programming ppt](https://m365contenthub.wpengine.com/wp-content/uploads/2024/06/What-is-touch-typing-and-why-is-it-important-494x278-1.jpg)
What is touch typing (and why is it important)?
Learn about the benefits of touch typing and how it can help you type faster and more accurately.
![problem solving and programming ppt problem solving and programming ppt](https://m365contenthub.wpengine.com/wp-content/uploads/2024/06/Is-it-per-say-or-per-se-494x278-1.jpg)
Is it “per say” or ‘per se’?
Address the misspelling of ‘per se’ to effectively communicate the intrinsic quality of something. Learn why it is commonly misspelled and how to use it correctly in your writing.
![problem solving and programming ppt problem solving and programming ppt](https://m365contenthub.wpengine.com/wp-content/uploads/2024/06/Elicit-vs-Illicit-Whats-the-difference-494x278-1.jpg)
Elicit vs. illicit: What’s the difference?
Learn the difference between illicit vs. elicit, two homophones that sound alike but mean different things, and write without confusion.
![problem solving and programming ppt Microsoft 365 Logo](https://m365contenthub.wpengine.com/en-us/wp-content/uploads/M356_Logo_180x30.png)
Everything you need to achieve more in less time
Get powerful productivity and security apps with Microsoft 365
![problem solving and programming ppt LinkedIn Logo](https://m365contenthub.wpengine.com/wp-content/uploads/2023/01/LinkedIn.png)
Explore Other Categories
![](http://academichelp.site/777/templates/cheerup/res/banner1.gif)
IMAGES
VIDEO
COMMENTS
Rheigh Henley Calderon. The document discusses the steps of problem solving which include identifying the problem, understanding it, identifying alternative solutions, selecting the best solution, listing instructions to implement it, and evaluating the solution. It also describes types of problems that can be solved algorithmically or ...
The document outlines the objectives and contents of the course GE3151 Problem Solving and Python Programming. The objectives include understanding algorithmic problem solving, solving problems using Python conditionals and loops, defining functions, and using data structures like lists, tuples and dictionaries.
MIT OpenCourseWare is a web based publication of virtually all MIT course content. OCW is open and available to the world and is a permanent MIT activity
The document summarizes the use of robots and graphical programming in a software education module. It discusses that the first 8 weeks focus on problem-solving using robots. Students are assessed through a robot-based project. The remaining 16-17 weeks cover Java programming, assessed by building a GUI version of the first assignment.
Problem solving vs. programming Problem solving vs. algorithm development vs. programming Problem Solving understand and define the problem what is it that needs to be solved Identify an approach the basic equations, relations, etc Develop and specify an algorithm sequence of steps to be executed specify how data is organized .
Problem solving means the ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately. Identify or Define the problem Analyze the problem in terms of inputs, outputs, formulas, constants) Design the Solution Implement (program coding) Evaluate We need to read it till we understand every detail ...
Problem solving is the process of transforming the description of a problem into a solution by using our knowledge of the problem domain and by relying on our ability to select and use appropriate problem-solving strategies, techniques and tools. Computers can be used to help us solving problems Principles of Programming - NI July 2005.
Outcomes:Demonstrate the basic knowledge of computer hardware and. ftware.To formulate simple algorithms for arithmetic a. logical problems.To translate the algorithms to programs (in C langu. e).To test and execute the programs and correct syntax and logical errors.Ability to apply solvin.
Carter (2004) "Programming is a complex activity…. Problem Solving is not trivial and requires component skills including relativity; decision making; identification of the central issues; recognition of relationships, familiar situations and patterns; development of an algorithm and the translation of the algorithm into executable code.
Applying Polya's Problem Solving to Programming Step 2 - Devise a Plan • Find connections between the knowns and unknowns. • Simplify: Break the problem into smaller sub-problems • Design a solution • Make a plan or list of actions to implement the solution • Algorithm / Flowchart / Psuedocode.
Chapter 1 Introduction to Object-Oriented Programming and Problem Solving. Knowledge Goals • Understand what a computer programis • Know the three phases of the software life cycle • Understand what an algorithm is • Learn what a high-level programminglanguage is • Understand the difference between machine code and Bytecode. Knowledge Goals • Understand the compilation, execution ...
NPTEL :: Computer Science and Engineering - Introduction to Problem Solving and Programming. Courses. Computer Science and Engineering. Introduction to Problem Solving and Programming (Video) Syllabus. Co-ordinated by : IIT Kanpur. Available from : 2009-12-31.
Introduction to Problem Solving: Problem-solving strategies, Problem identification, Problem understanding, Algorithm development, Solution planning (flowcharts. ... Course: Problem Solving and Programming (COMS 304) 12 Documents. Students shared 12 documents in this course. University: Pondicherry University. Info More info. Download. AI Quiz ...
Slides introduce hardware and software components of Computer System and it also discusses generations of Programming language and Programming language translators. It will be Useful for 1st Engineering students of all disciplines. Engineering. 1 of 25. Download now. Programming for Problem Solving - Download as a PDF or view online for free.
Programming is a complex activity. Problem Solving is not trivial and requires component skills including relativity decision making identification of the central issues recognition of relationships, familiar situations and patterns development of an algorithm and the translation of the algorithm into executable code. Beaumont and Fox (2003) 5 ...
AN ALGORITHM IS A STEP BY STEP PROCEDURE FOR SOLVING A PROBLEM. ... The world's largest ball of twine is located in Cawker City, Kansas. ... - A free PowerPoint PPT presentation (displayed as an HTML5 slide show) on PowerShow.com - id: 1fccb9-ODBkO
Introduction to Computers, Problem Solving, and Programming Chapter 1 1.1 Overview of Computers Computer - A device for counting or computing Dr. John Atanasoff ... - A free PowerPoint PPT presentation (displayed as an HTML5 slide show) on PowerShow.com - id: 3d190a-Y2Y4M
Problem Solving and Programming An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.
Problem Solving PowerPoint Presentation Content slides include topics such as: teaching problem solving skills, evaluating how you solve problems, understanding the process: how to solve problems, 8 active listening techniques, primary issues for problem solvers, group or individual brainstorming, the problem solving framework, vertical and lateral thinking, adaptors and innovators as problem ...
Discussion This strategy can be applied in an engineering classroom for teaching engineering problem solving With laptops becoming more prevalent, there is no need to separate lab and lecture if programming is required as part of the solution ' In-class problem solving and programming ensures that students get to practice an important ...
ITB001Problem Solving and ProgrammingLecture 8 Faculty of Information Technology Queensland University of Technology. Aims of this lecture • This lecture further illustrates the notion of data abstraction with three important examples, tables, trees and tagged data • Tables introduce some of the basic operations needed to maintain databases ...
8. API - Application Programming Interface. An application programming interface (API) is a software that serves a distinct function between different software applications, allowing seamless data exchange and integration, thereby enhancing functionality and user experience. 9. SME - Subject Matter Experts
This document discusses problem solving skills and decision making. It outlines the steps of problem solving as defining the problem, generating alternatives, choosing the best alternative, and getting feedback. It describes various problem solving tools and techniques like the 5 whys, cause and effect analysis, and CATWOE analysis.
Problem solving is an instructional method where teachers and students work together to find solutions to educational problems. It is a student-centered approach that requires active participation. The problem solving process involves clearly defining the problem, collecting relevant data, organizing the data, drawing conclusions, and testing ...