SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Data Structures Discipline with Python
@fmasanori
I love teaching
CS Professor at FATEC
https://about.me/fmasanori
http://pycursos.com/python-para-zumbis/
Difficult with C language
"A C program is like a fast dance on a newly
waxed dance floor by people carrying razors."
Waldi Ravens. Programmer.
But I love Data Structures
Data Structures are cool
Data Structures with Python at FATEC
Retention 2008
85% retained
15% approved
Data Structures with C (2008)
Retention 2015
10% retained
90%approved
Data Structures with Python (2015)
C only:
– 85% retained (2008)
Python + C:
– 12% retained (2014)
– 10% retained (2015)
– ENADE grade 5/5 (max) (last grade)
– 1st Programming Contest InterFATECs
(1st/62) (2014 and 2015)
– Final Brazilian ICPC Programming 2015
Summary
• Lab Only – 4 classes/week
• 4 Lab Projects (Python)
• Big Brother (some of the best students could
help the other students as coaches)
• Algorithms in Python + C (side by side)
Details
Why Python?
http://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the-most-popular-
introductory-teaching-language-at-top-us-universities/fulltext
Usability is a problem for DS also...
"Results show that many aspects of traditional C-
style syntax, while it has influenced a generation of
programmers, exhibits problems in terms of
usability for novices".
"Perl and Java did not accuracy rates significantly
higher than a language with randomly generated
keywords"
Andreas Stefik and Susanna Siebert: "An Empirical Investigation into
Programming Language Syntax." ACM Transactions on Computing
Education, 13(4), Nov. 2013.
The most common fault in computer classes is to
emphasize the rules of specific programming
languages, instead of to emphasize the algorithms
that are being expressed in those languages. D. Knuth
interview at People of ACM, June, 2014.
Talk is cheap.
Show me the code.
Linus Torvalds
• C is good for optimization (details, low level)
• Python is good to show the essence of the
algorithms (readability, high level)
• If the algorithm is the same (complexity)
“premature optimization is evil” also in
teaching Data Structures
• We are using Python + C with success
TL DR
Variables are just names (references)
References == “pointers”
Big integers
Natural integer division
Multiple assignment
"The programming activity should be viewed
as a process of creating works of literature,
written to be read. “
--D.E. Knuth
Identation
Identation in C
Identation in C
Recursion
"To understand recursion, one must first
understand recursion."
--folklore
"To solve the problem, I found barriers within
barriers. So, I adopted a recursive solution. "
--a student
Ref.: Feofiloff, P., Algoritmos em C, Editora Campus, 2009.
Recursion
Recursion
Recursion
Recursion (student solution for dec2bin problem)
Linked Lists
Linked Lists
Linked Lists
FIFOs: Distance in Networks
FIFOs: Distance in Networks
FIFOs: Distance in Networks
Stacks: well-formed expression
Stacks: well-formed expression
Selection Sort
Selection Sort
Quicksort
Quicksort
Word Count
Word Count, please download http://www.gutenberg.org/cache/epub/11/pg11.txt
Projects: Sorting Algorithm comparison
Projects: Arthur Merlin Games simplification
Jessica Pâmela
Leandro
Fernanda Renata
WalberGabrielDiogo EclisBrunoAdriano
Leandro
Walber
Gabriel Diogo
Eclis
Bruno
Adriano
Projects: Binaries regions
Projects: Minimum Degree Greedy Heuristic for MIS
• C is good for optimization (details, low level)
• Python is good to show the essence of the
algorithms (readability, high level)
• If the algorithm is the same (complexity)
“premature optimization is evil” also in
teaching Data Structures.
• We are using Python + C with success
Conclusions
Questions?
gist.github.com/fmasanori
http://about.me/fmasanori
fmasanori@gmail.com
Slides: bit.ly/python-DS

Weitere ähnliche Inhalte

Mehr von FATEC São José dos Campos

Lista de exercícios III Desafios python para zumbis
Lista de exercícios III Desafios python para zumbisLista de exercícios III Desafios python para zumbis
Lista de exercícios III Desafios python para zumbis
FATEC São José dos Campos
 

Mehr von FATEC São José dos Campos (20)

Seja feliz programando em python
Seja feliz programando em pythonSeja feliz programando em python
Seja feliz programando em python
 
import pybr12: experiencias de inclusión en la última PyCon Brazil
import pybr12: experiencias de inclusión en la última PyCon Brazilimport pybr12: experiencias de inclusión en la última PyCon Brazil
import pybr12: experiencias de inclusión en la última PyCon Brazil
 
Import community pycon jp
Import community pycon jpImport community pycon jp
Import community pycon jp
 
Import community
Import communityImport community
Import community
 
Diversidade na Comunidade Python
Diversidade na Comunidade PythonDiversidade na Comunidade Python
Diversidade na Comunidade Python
 
Why python
Why pythonWhy python
Why python
 
Hackeando Dados públicos com python
Hackeando Dados públicos com pythonHackeando Dados públicos com python
Hackeando Dados públicos com python
 
Import community
Import communityImport community
Import community
 
Python, the next Brazilian generation
Python, the next Brazilian generationPython, the next Brazilian generation
Python, the next Brazilian generation
 
Para gostar de Python DevDay
Para gostar de Python DevDay Para gostar de Python DevDay
Para gostar de Python DevDay
 
Classic Games with Python in the browser
Classic Games with Python in the browserClassic Games with Python in the browser
Classic Games with Python in the browser
 
Exercício Programa 1 Python para Zumbis
Exercício Programa 1 Python para ZumbisExercício Programa 1 Python para Zumbis
Exercício Programa 1 Python para Zumbis
 
Lista de exercícios V python para zumbis
Lista de exercícios V python para zumbisLista de exercícios V python para zumbis
Lista de exercícios V python para zumbis
 
Lista de exercícios IV python para zumbis
Lista de exercícios IV python para zumbisLista de exercícios IV python para zumbis
Lista de exercícios IV python para zumbis
 
Lista de exercícios III Desafios python para zumbis
Lista de exercícios III Desafios python para zumbisLista de exercícios III Desafios python para zumbis
Lista de exercícios III Desafios python para zumbis
 
Lista de exercícios II python para zumbis
Lista de exercícios II python para zumbisLista de exercícios II python para zumbis
Lista de exercícios II python para zumbis
 
Lista de exercícios I python para zumbis
Lista de exercícios I python para zumbisLista de exercícios I python para zumbis
Lista de exercícios I python para zumbis
 
Lista de exercícios XIV Python para Zumbis
Lista de exercícios XIV Python para ZumbisLista de exercícios XIV Python para Zumbis
Lista de exercícios XIV Python para Zumbis
 
TWP56 DJ Mix 1
TWP56 DJ Mix 1TWP56 DJ Mix 1
TWP56 DJ Mix 1
 
TWP54 Exceções
TWP54 ExceçõesTWP54 Exceções
TWP54 Exceções
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

Teaching Data Structures with Python