SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
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

Contenu connexe

Plus de FATEC São José dos Campos

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 BrazilFATEC 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 zumbisFATEC São José dos Campos
 

Plus de 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
 

Dernier

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
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 FellowsMebane Rash
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
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 17Celine George
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
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).pptxEsquimalt MFRC
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 

Dernier (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
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
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.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
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Teaching Data Structures with Python