Skip to content

NUS CS1010 Lecture Notes for AY22/23 Semester 1

Intermediate C

  • 26. Structure

    Defining your own composite data type with struct

  • 27. Standard C I/O

    Use printf and scanf and their pitfalls

Algorithms

  • 20. Efficiency

    Quantify the efficiency of an algorithm with big-O running time.

  • 21. Searching

    How to look for an element in a list.

  • 22. Sorting

    How to rearrange a list of items into an order.

  • 23. Tower of Hanoi

    Solving the Tower of Hanoi recursively.

  • 24. Permutation

    Generate all possible permutations recursively.

  • 25. N-Queens

    Solving the N-Queens problem, recursively.

Arrays, Pointers, Memory Management

  • 13. Call Stack

    How calling a function and passing parameters by-value works.

  • 14. Fixed-Length Array

    How arrays are implemented and can be used in C

  • 15. Pointers

    How to access a variable via its address

  • 16. Call-by-Reference

    How to modify a variable by passing it into a function

  • 17. Heap

    Dynamically allocating and deallocating memory

  • 18. Characters and Strings

    Representing a string as an array of chars

  • 19. Multidimensional Array

    Using array of arrays

Control Statements

  • 8. Conditional Statements

    Implementing conditional control in C

  • 9. Logical Expressions

    How to express compound logical expressions in C

  • 10. Assertions

    Asserting what must be true at each point of the program.

  • 11. Loops

    Implementing iterative control in C

  • 12. Invariant

    Reasoning about loops with invariant

Basic C

  • 5. First C Program

    Introducing basic C syntax and writing our first C program.

  • 6. CS1010 I/O

    Reading from the stdin and printing to the stdout using the CS1010 library.

  • 7. Arithmetic Operations

    Performing basic computation with arithmetic operations with C.

Preliminaries

  • 1. Programming

    What is a program? What is programming? What is CS1010 about?

  • 2. Computational Problems

    What is a computational problem? Express a step-by-step solution to a computational problem with a flowchart.

  • 3. Functions

    Write functions that solve simpler sub-problems and then combine the functions to solve higher-level and more complex problems.

  • 4. Types

    Each variable has a type that tell the machine how to turn a bit sequence into a meaningful value.

Unix

  • Background

    Understand the design principles of Unix and its power through its historical background.

  • Essential Unix Commands

    Learn the essential commands to perform day-to-day operations in a Unix shell.

  • Advanced Unix Commands

    Level-up your productivity when operating in a Unix shell.

Vim

  • Philosophy of Vim

    Understand the philosophy behind the design of Vim and why it is useful.

  • Quick Vim Lessons

    Learn the basic commands of Vim for navigation and editing.

  • Vim Setup

    Set up your Vim properly for CS1010.

  • Vim Extensions

    Learn about Vim extensions officially supported by CS1010.

  • Vim Tips for CS1010

    Read about useful vim tips for CS1010.

CS1010 PE

  • CS1010 Programming Environment

    We will be using a programming environment for CS1010 labs and practical exams.

  • Linking GitHub to CS1010 PE

    We use GitHub Classroom for our labs. Here is how to link your GitHub account to your PE accounts.