SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Was ist angesagt?

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

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Kürzlich hochgeladen

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Kürzlich hochgeladen (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.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
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
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
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.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
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

C1320prespost