ACM Cheat Sheet

This is a manual that introduces some examples of code for classic algorithm problems, suitable for writing on paper.


ACM Cheat Sheet - cover page
Category
Other software
Document type
Other
Language
English
Pages
338
File format
PDF
File size
2.9 MB
Published
30 October, 2023
Updated
30 October, 2023
MD5 checksum
66246DD19D39208F96C1FADF4C4E3F38

About this manual

This document serves as a cheat sheet for competitive programming, specifically focusing on the ACM (Association for Computing Machinery) context. It provides quick reference material for C and C++ standard library functions, including string manipulation, memory management, and input/output operations.

The guide covers a wide range of topics essential for algorithmic problem solving, including linear lists, stacks, queues, and various search algorithms like KMP and Rabin-Karp. It also details data structures such as trees (Morris Traversal), tries, and graphs, along with sorting and searching algorithms like Merge Sort, Quick Sort, and Dijkstra's algorithm.

What's inside

  • C/C++ Standard Library
  • Data Structures
  • Search Algorithms
  • Sorting Algorithms
  • Graph Algorithms
  • Dynamic Programming
  • Number Theory
  • Geometry
  • Combinatorics
  • String Algorithms

Frequently asked questions

What does the strstr function return when the needle string is empty?

It returns the full haystack string. The code checks for an empty needle first and returns the haystack cast to char*.

What does the strcpy implementation require of its two pointer arguments?

It requires that both to and from are not NULL, which it checks with an assert at the start of the function.

What does the strlen implementation return?

It advances a pointer s from str until it reaches the terminating character, then returns the difference s - str.

Download PDF (2.9 MB)

Also Manuals