SlideShare uma empresa Scribd logo
1 de 30
Sticky Bits in C ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sticky Bits in C Control Structures
Control Structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sticky Bits in C Variable Types And Pointers!
Data Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pointer Variable Notes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using Pointers to Allocate Space ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sticky Bits in C Recursion Recursion Recursion Recursion Recursion Recursio Recurs
Recursion Development ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursion - Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],It should be noted that one of the most difficult things about recursion with Fibonacci is the magical decision to  number  the Fibonacci elements and then to use that number as  n .  This is akin to mathematical proofs where the author says “So now we let  k  stand for  a+*m%r#p^t  …”
Recursion - What is it doing!?@#! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Fib(5) =  5   Fib(4) =  3   Fib(3) =  2   Fib(3) =  2   Fib(2) =  1   Fib(2) =  1   Fib(1) =  1   Fib(2) =  1 Fib(1) =  1   = + + + + = = = 2 2 5 3 Notice that the recursion isn’t finished at the bottom -- It must unwind all the way back to the top in order to be done.
Recursion - Should I or Shouldn’t I? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Sticky Bits in C Arrays and Structs
Aggregate Data Structures ,[object Object],[object Object],[object Object],[object Object],[object Object]
Aggregate Data Types - Structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structure Operations  and Member Accessing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arrays and Pointers and Structures Oh My! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],H E T D S A E C M 3.95 Imad Tibi 744521111 E 4.0 Rose Axel 000003789 P 3.4 Marta Luitania 654903211 major[4] GPA first_nm last_nm ID_num
Sticky Bits in C Linked Lists
Data Structures built with Structs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],UTA UTA UTA UTA ->next_stdt ->next_stdt ->next_stdt
Linked Lists ,[object Object],[object Object],[object Object],[object Object],[object Object],UTA UTA UTA ->next_stdt ->next_stdt ->next_stdt head travel UTA new UTA
Linked Lists ,[object Object],[object Object],[object Object],[object Object],UTA pi A list element might consist of a  uta_student  struct with a  last_name  value of  pi  along with other member values UTA UTA UTA UTA ->next_stdt ->next_stdt ->next_stdt head travel UTA new alpha phi nu  tau  zeta
Linking the List ,[object Object],[object Object],[object Object],[object Object],[object Object],new = (struct uta_student *)malloc (sizeof (struct uta_student)); new->last_name = “pi”; /* other data initialized */ (*new).next_stdt = NULL;
Linking the List ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],/* in some sort of loop */ if ( new->last_name < travel->last_name) /* then new goes in the list before travel */ else  travel = travel->next_stdt; UTA UTA UTA UTA ->next_stdt ->next_stdt ->next_stdt head travel alpha UTA new phi nu  tau  zeta
Linking the List ,[object Object],[object Object],[object Object],[object Object],[object Object],/* using the  travel  pointer and a  follow  pointer which is one link behind the  travel  pointer */ if ( new->last_name < travel->last_name) { /*  insert node */ new->next_stdt = travel; follow->next_stdt = new;  }
Doubly Linking the List ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],UTA UTA UTA UTA ->next_stdt ->next_stdt ->next_stdt head travel UTA new alpha phi nu  tau  zeta ->prev_stdt ->prev_stdt ->prev_stdt follow
Doubly Linking the List if ( new->last_name < travel->last_name) { /*  insert node */ new->next_stdt = travel; new->prev_stdt = follow; follow->next_stdt = new; travel->prev_stdt = new;   } ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],UTA UTA UTA ->next_stdt ->next_stdt follow travel tau  ->prev_stdt ->prev_stdt new nu  phi
Sticky Bits in C Debugging. Ugh.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Debugging. Ugh.
Debugging. Ugh. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Debugging. Ugh.

Mais conteúdo relacionado

Mais procurados

C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
Kushaal Singla
 
هياكلبيانات
هياكلبياناتهياكلبيانات
هياكلبيانات
Rafal Edward
 

Mais procurados (20)

Arrays
ArraysArrays
Arrays
 
Array Of Pointers
Array Of PointersArray Of Pointers
Array Of Pointers
 
Chapter 11 ds
Chapter 11 dsChapter 11 ds
Chapter 11 ds
 
Ch13
Ch13Ch13
Ch13
 
Unit 1 introduction to data structure
Unit 1   introduction to data structureUnit 1   introduction to data structure
Unit 1 introduction to data structure
 
Chapter 5 ds
Chapter 5 dsChapter 5 ds
Chapter 5 ds
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
Structures and Pointers
Structures and PointersStructures and Pointers
Structures and Pointers
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Array Cont
Array ContArray Cont
Array Cont
 
Chapter 4 ds
Chapter 4 dsChapter 4 ds
Chapter 4 ds
 
Unit v
Unit vUnit v
Unit v
 
Recursion and Sorting Algorithms
Recursion and Sorting AlgorithmsRecursion and Sorting Algorithms
Recursion and Sorting Algorithms
 
Structures
StructuresStructures
Structures
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
C Programming - Refresher - Part II
C Programming - Refresher - Part II C Programming - Refresher - Part II
C Programming - Refresher - Part II
 
Unit 4 qba
Unit 4 qbaUnit 4 qba
Unit 4 qba
 
Unit 4 qba
Unit 4 qbaUnit 4 qba
Unit 4 qba
 
هياكلبيانات
هياكلبياناتهياكلبيانات
هياكلبيانات
 
LectureNotes-05-DSA
LectureNotes-05-DSALectureNotes-05-DSA
LectureNotes-05-DSA
 

Destaque

Chatham mba open house (10 5 2013 rc)
Chatham mba open house (10 5 2013 rc)Chatham mba open house (10 5 2013 rc)
Chatham mba open house (10 5 2013 rc)
Rachel Chung
 
Vishal anand director of bricks and mortar
Vishal anand director of bricks and mortarVishal anand director of bricks and mortar
Vishal anand director of bricks and mortar
New Projects Noida
 
Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014
Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014
Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014
Tanya Madjarova
 
Supply chain-management
Supply chain-managementSupply chain-management
Supply chain-management
Neha Suman
 
Msu bmp widescreen
Msu bmp widescreenMsu bmp widescreen
Msu bmp widescreen
Josh Johnson
 
Presentation1
Presentation1Presentation1
Presentation1
kiranvpr
 

Destaque (20)

Chatham mba open house (10 5 2013 rc)
Chatham mba open house (10 5 2013 rc)Chatham mba open house (10 5 2013 rc)
Chatham mba open house (10 5 2013 rc)
 
Vishal anand director of bricks and mortar
Vishal anand director of bricks and mortarVishal anand director of bricks and mortar
Vishal anand director of bricks and mortar
 
Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014
Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014
Awards Ceremony: K.C.'s Nominations, Romain Rolland FLS, 2014
 
CSR Skills: What you need and why
CSR Skills: What you need and whyCSR Skills: What you need and why
CSR Skills: What you need and why
 
Z0955523DISS
Z0955523DISSZ0955523DISS
Z0955523DISS
 
Real ch.2 a
Real ch.2 aReal ch.2 a
Real ch.2 a
 
MyEpcTeam v1.1
MyEpcTeam v1.1MyEpcTeam v1.1
MyEpcTeam v1.1
 
Rcm
RcmRcm
Rcm
 
Supply chain-management
Supply chain-managementSupply chain-management
Supply chain-management
 
Irregular verbs
Irregular verbsIrregular verbs
Irregular verbs
 
25martiou2013
25martiou201325martiou2013
25martiou2013
 
Cv
CvCv
Cv
 
Mal ppt 2013
Mal ppt 2013Mal ppt 2013
Mal ppt 2013
 
Msu bmp widescreen
Msu bmp widescreenMsu bmp widescreen
Msu bmp widescreen
 
Notam 01 jun 15
Notam 01 jun 15Notam 01 jun 15
Notam 01 jun 15
 
Cables Brochure Web
Cables Brochure WebCables Brochure Web
Cables Brochure Web
 
Module1
Module1Module1
Module1
 
How To Keep Your Apache Project's Independence
How To Keep Your Apache Project's IndependenceHow To Keep Your Apache Project's Independence
How To Keep Your Apache Project's Independence
 
Presentation1
Presentation1Presentation1
Presentation1
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 

Semelhante a C1320prespost

Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2
IIUM
 
C++ - UNIT_-_IV.pptx which contains details about Pointers
C++ - UNIT_-_IV.pptx which contains details about PointersC++ - UNIT_-_IV.pptx which contains details about Pointers
C++ - UNIT_-_IV.pptx which contains details about Pointers
ANUSUYA S
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
J. C.
 
Data structure and algorithms chapter three LINKED LIST
Data structure and algorithms chapter three LINKED LISTData structure and algorithms chapter three LINKED LIST
Data structure and algorithms chapter three LINKED LIST
binakasehun2026
 

Semelhante a C1320prespost (20)

Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2
 
Easy Understanding of Structure Union Typedef Enum in C Language.pdf
Easy Understanding of Structure Union Typedef Enum in C Language.pdfEasy Understanding of Structure Union Typedef Enum in C Language.pdf
Easy Understanding of Structure Union Typedef Enum in C Language.pdf
 
C++ - UNIT_-_IV.pptx which contains details about Pointers
C++ - UNIT_-_IV.pptx which contains details about PointersC++ - UNIT_-_IV.pptx which contains details about Pointers
C++ - UNIT_-_IV.pptx which contains details about Pointers
 
B T0065
B T0065B T0065
B T0065
 
Pointers and Structures
Pointers and StructuresPointers and Structures
Pointers and Structures
 
DS_PPT.pptx
DS_PPT.pptxDS_PPT.pptx
DS_PPT.pptx
 
Chap 4 List of Data Structure.ppt
Chap 4 List of Data Structure.pptChap 4 List of Data Structure.ppt
Chap 4 List of Data Structure.ppt
 
structures.ppt
structures.pptstructures.ppt
structures.ppt
 
Introduction to structures in c lang.ppt
Introduction to structures in c lang.pptIntroduction to structures in c lang.ppt
Introduction to structures in c lang.ppt
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
 
C structure and union
C structure and unionC structure and union
C structure and union
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
 
Data structure and algorithms chapter three LINKED LIST
Data structure and algorithms chapter three LINKED LISTData structure and algorithms chapter three LINKED LIST
Data structure and algorithms chapter three LINKED LIST
 
Structures
StructuresStructures
Structures
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptx
 
CLASSES, STRUCTURE,UNION in C++
CLASSES, STRUCTURE,UNION in C++CLASSES, STRUCTURE,UNION in C++
CLASSES, STRUCTURE,UNION in C++
 
Cs341
Cs341Cs341
Cs341
 
Pointers and Dynamic Memory Allocation
Pointers and Dynamic Memory AllocationPointers and Dynamic Memory Allocation
Pointers and Dynamic Memory Allocation
 
C Programming - Refresher - Part III
C Programming - Refresher - Part IIIC Programming - Refresher - Part III
C Programming - Refresher - Part III
 
Data structures
Data structuresData structures
Data structures
 

Mais de FALLEE31188 (20)

Lecture4
Lecture4Lecture4
Lecture4
 
Lecture2
Lecture2Lecture2
Lecture2
 
L16
L16L16
L16
 
L2
L2L2
L2
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Functions
FunctionsFunctions
Functions
 
Field name
Field nameField name
Field name
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
Cis068 08
Cis068 08Cis068 08
Cis068 08
 
Chapter14
Chapter14Chapter14
Chapter14
 
Chapt03
Chapt03Chapt03
Chapt03
 
C++lecture9
C++lecture9C++lecture9
C++lecture9
 
C++ polymorphism
C++ polymorphismC++ polymorphism
C++ polymorphism
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Brookshear 06
Brookshear 06Brookshear 06
Brookshear 06
 
Book ppt
Book pptBook ppt
Book ppt
 
Assignment 2
Assignment 2Assignment 2
Assignment 2
 
Assignment
AssignmentAssignment
Assignment
 

Último

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
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
heathfieldcps1
 

Último (20)

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
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
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
 
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...
 
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
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
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
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.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.
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
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...
 
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
 
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
 
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
 

C1320prespost