Pointers, Arrays, and Recursion
Pointers, Arrays, and Recursion
This course is part of Introductory C Programming Specialization
46,424 already enrolled
Included with
Ask Coursera
349 reviews
349 reviews
Tools you'll learn
Details to know
See how employees at top companies are mastering in-demand skills
Build your subject-matter expertise
- Learn new concepts from industry experts
- Gain a foundational understanding of a subject or tool
- Develop job-relevant skills with hands-on projects
- Earn a shareable career certificate
There are 5 modules in this course
The third course in the specialization Introduction to Programming in C introduces the programming constructs pointers, arrays, and recursion. Pointers provide control and flexibility when programming in C by giving you a way to refer to the location of other data. Arrays provide a way to bundle data by guaranteeing sequences of data are grouped together. Finally, recursive functions—functions that call themselves—provide an alternative to iteration that are very useful for implementing certain algorithms.
Pointers are one of the most important and powerful aspects of the C language. Pointers are critical to understanding arrays, which let you manipulate sequences of data. They also give a programmer control and flexibility when programming, enabling solutions that are clean and efficient. Some other languages use pointers implicitly—or pointer-like constructs—so understanding their use will make you a better programmer in any language.
What's included
5 videos14 readings3 assignments2 programming assignments
5 videos•Total 16 minutes
- Introduction to Pointers, Arrays, and Recursion•2 minutes
- Naive Swap•2 minutes
- Pointers•3 minutes
- Corrected Swap•3 minutes
- Swap with Hardware•6 minutes
14 readings•Total 140 minutes
- Report a problem with the course•10 minutes
- Pointer Basics•10 minutes
- Pictures•10 minutes
- Swap Revisited•10 minutes
- The Practice Programming Environment•10 minutes
- Pointers under the Hood•10 minutes
- A Program's View of Memory•10 minutes
- NULL•10 minutes
- Pointers to Structs•10 minutes
- Pointers to Pointers•10 minutes
- const•10 minutes
- Aliasing•10 minutes
- Pointer Arithmetic•10 minutes
- Use Memory Checker Tools•10 minutes
3 assignments•Total 90 minutes
- Pointers Conceptually•30 minutes
- Pointers in Hardware•30 minutes
- Pointers to Sophisticated Types•30 minutes
2 programming assignments•Total 40 minutes
- Assignment 11_read_ptr1•20 minutes
- Assignment 12_read_ptr2•20 minutes
Arrays are sequences of memory of the same type that are guaranteed to be one after another. This is an incredibly useful data format, enabling you to store many things together under one variable name. In this module, you will learn how to use arrays to solve more complex problems and lay the groundwork for more complex data types.
What's included
5 videos7 readings1 assignment4 programming assignments
5 videos•Total 18 minutes
- Array Access with Pointer Arithmetic•3 minutes
- Array Access with Pointer Indexing•2 minutes
- Index of Largest Element•7 minutes
- Closest Point Step-Through•3 minutes
- Dangling Pointers•4 minutes
7 readings•Total 70 minutes
- Cryptography Motivation•10 minutes
- Array Declaration and Initialization•10 minutes
- Accessing an Array•10 minutes
- Passing Arrays as Parameters•10 minutes
- Writing Code with Arrays•10 minutes
- Dangling Pointers•10 minutes
- Array Size•10 minutes
1 assignment•Total 30 minutes
- Array Basics•30 minutes
4 programming assignments•Total 120 minutes
- Assignment 13_read_arr1•30 minutes
- Assignment 14_array_max•30 minutes
- Assignment 15_tests_subseq•30 minutes
- Assignment 16_subseq•30 minutes
Now that you have mastered the basics of pointers and arrays, it is time to see some important uses of them. In this module, you will learn about how to manipulate strings and multi-dimensional arrays. You will also learn about function pointers, which allow you to pass "which function to call" as the parameter of another function.
What's included
4 videos16 readings2 assignments4 programming assignments
4 videos•Total 22 minutes
- Compare Two Strings•7 minutes
- Copy a String•5 minutes
- Incompatible Representations•5 minutes
- Buffer Overflow•4 minutes
16 readings•Total 160 minutes
- String Literals•10 minutes
- Mutable Strings•10 minutes
- String Equality•10 minutes
- String Copying•10 minutes
- Converting Strings to ints•10 minutes
- Standard Library Functions•10 minutes
- Introduction•10 minutes
- Declaration•10 minutes
- Indexing•10 minutes
- Initializing•10 minutes
- Array of Pointers•10 minutes
- Incompatibility•10 minutes
- Array of Strings•10 minutes
- Function Pointer Basics•10 minutes
- Sorting Functions•10 minutes
- Format String Attacks•10 minutes
2 assignments•Total 60 minutes
- Function Pointers•30 minutes
- Security Hazards•30 minutes
4 programming assignments•Total 120 minutes
- Assignment 17_read_arr2•30 minutes
- Assignment 18_reverse_str•30 minutes
- Assignment 19_bits_arr•30 minutes
- Assignment 20_rot_matrix•30 minutes
By now you are familiar with iteration, in which repetition is expressed in terms of loops. Another programming technique to accomplish similar ideas is "recursion" in which a more complex instance of a problem is expressed in terms of solutions to simpler instances of the problem. In this module, you will learn how to read and write recursive code, giving you another powerful option for how to approach programming problems.
What's included
9 videos8 readings1 assignment3 programming assignments
9 videos•Total 34 minutes
- Executing Recursive Factorial by Hand•2 minutes
- Writing Factorial Recursively•6 minutes
- Translating Recursive Factorial to Code•1 minute
- Writing Fibonacci Recursively•7 minutes
- Translate Recursive Fibonacci to Code•4 minutes
- Duplication of Computation in Fibonacci•1 minute
- Execution of the Tail Recursive Implementation of Factorial•5 minutes
- Execution of Mutually Recursive isOdd and isEven•1 minute
- Advice from a Duke Software Engineering Alum: Solve Real-World Problems•5 minutes
8 readings•Total 72 minutes
- Introduction to Recursion•2 minutes
- Reading Recursive Code•10 minutes
- Principles of Writing Recursive Code•10 minutes
- Is Recursion Slow?•10 minutes
- Tail Recursion•10 minutes
- Equivalence of Tail Recursion and Iteration•10 minutes
- Mutual Recursion•10 minutes
- (Optional) Recursion Theory•10 minutes
1 assignment•Total 30 minutes
- Reading Recursion•30 minutes
3 programming assignments•Total 60 minutes
- Assignment 21_read_rec1•0 minutes
- Assignment 22_tests_power•30 minutes
- Assignment 23_power_rec•30 minutes
Now that you have learned about pointers and arrays, you will build on the code you wrote in Course 2 to build a deck of cards and evaluate a poker hand. In the next course, you will complete the program to calculate poker odds with a Monte Carlo simulation.
What's included
4 readings2 programming assignments
4 readings•Total 32 minutes
- If you did not take Course 2...•10 minutes
- Building a Deck•2 minutes
- Evaluating a Hand•10 minutes
- Share your learning experience•10 minutes
2 programming assignments•Total 150 minutes
- Assignment c3prj1_deck•90 minutes
- Assignment c3prj2_eval•60 minutes
Earn a career certificate
Add this credential to your LinkedIn profile, resume, or CV. Share it on social media and in your performance review.
Instructors
Offered by
Explore more from Software Development
- Status: Free TrialD
Duke University
Course
- Status: Free Trial
- Status: Free TrialD
Dartmouth College
Course
- Status: Free TrialD
Dartmouth College
Course
Why people choose Coursera for their career
Learner reviews
- 5 stars
65.04%
- 4 stars
19.48%
- 3 stars
5.73%
- 2 stars
2.57%
- 1 star
7.16%
Showing 3 of 349
Reviewed on Oct 19, 2020
Great introductory course for those who want to learn primitive part of programing.
Reviewed on Dec 20, 2019
Teaches you how to use GDB and debug code effectively. Challenging and engaging homework.
Reviewed on Jun 2, 2019
Great course that taught important programming topics.
Advance your career with an online degree
Earn a degree from world-class universities - 100% online
Frequently asked questions
No. Completion of a Coursera course does not earn you academic credit from Duke; therefore, Duke is not able to provide you with a university transcript. However, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.
To access the course materials, assignments and to earn a Certificate, you will need to purchase the Certificate experience when you enroll in a course. You can try a Free Trial instead, or apply for Financial Aid. The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.
When you enroll in the course, you get access to all of the courses in the Specialization, and you earn a certificate when you complete the work. Your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.
More questions
Financial aid available,
