Skip to content

NUS CS1010 Handbook for AY24/25 Semester 1


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.

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.

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

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

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.

Intermediate C

  • 26. Structure

    Defining your own composite data type with struct

  • 27. Standard C I/O

    Use printf and scanf and their pitfalls

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.

  • Using tmate

    tmate is a tool that is useful for sharing terminal with others.

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.

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.

C

  • C in CS1010

    C is a programming language with some nuances that get in the way of learning programming for beginners. CS1010 bans and discourages some of these features.

  • CS1010 I/O Library

    One of the ways CS1010 simplify C programming for beginners is to provide a library for robust reading and writing of common types without resorting to printf and scanf. Read more about this libcs1010 library here.

  • C Style Guide

    Read more about the expected coding style that CS1010 has to follow

  • C Documentation Guide

    Read more about the expected documentation format that CS1010 has to follow

  • Compiling with clang

    CS1010 hides much details about the use of clang, the C language compiler, behind the provided Makefile. Students wishing to learn how to compile using clang can learn more here..