SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
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

Más contenido relacionado

Más 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
 

Más 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
 

Último

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
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.pptxDenish Jangid
 
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...pradhanghanshyam7136
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
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.christianmathematics
 
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
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
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
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
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
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
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
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 

Último (20)

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
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...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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.
 
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Ữ Â...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
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
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.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
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 

Teaching Data Structures with Python