Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTCI

Cracking the Coding Interview - Solutions in C

Project Structure

CTCI/
├── lib/                    # Reusable code
├── XX/YY/                  # Chapter XX, Problem YY
│   ├── problem.h
│   ├── problem.c
│   └── main.c
├── 00/00/                  # Sample problem for testing the build system
├── Makefile                # Top-level Makefile
└── README.md

Building

The project uses a top-level Makefile that compiles all .c and .h files in the repository.

Prerequisites

  • Linux runtime
  • GCC compiler
  • Make

Build Commands

# Build all problems
make all

# Clean build artifacts
make clean

# Build and run all problems
make run

# Build and run a specific problem (e.g. chapter 01 problem 01)
make run 01/01

# Show help
make help

Adding New Problems

To add a new problem:

  1. Create a directory: mkdir -p XX/YY (where XX is chapter, YY is problem number)
  2. Add your files:
    • problem.h - Problem interface
    • problem.c - Problem implementation
    • main.c - Test cases and main function
  3. Run make all to build
  4. Run make run to test

The Makefile will automatically discover and build your new problem.

Library

The lib/ directory contains reusable data structures and algorithms that can be used across problems. Include them with:

#include "linkedlist.h"  // Example library

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages