Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.06 KB

File metadata and controls

39 lines (29 loc) · 1.06 KB

Data Structures and Algorithms

Collection of Algorithms and Data Structures in different languages

Rust

cd rust
cargon run

C++

# to compile and run
cd cpp
g++ -std=c++17 src/main.cpp src/chapter_1_binary_search.cpp src/chapter_2_selection_sort.cpp -o target/binary_search && target/binary_search

Data structures

This section is for learning purposes. Those data structure may or may not be suitable for real world usage.

One way to compile

mdkir build
gcc  [SOURCE_FILE] -o build/[OUTPUT_FILE] && ./buld/[OUTPUT_FILE] 
# the position of -o flag matters
gcc -Wall -Wextra  data_structures/c/main.c data_structures/c/vector.c -o build/main && ./build/main

Compiler Flags

  • -Wall — enables most common warnings (unused variables, missing returns, etc.)
  • -Wextra — enables additional warnings that -Wall doesn't cover (unused parameters, sign comparison, etc.)
  • -o vector/main — sets the output file name
  • -Werror — (optional) treats warnings as errors, forces you to fix them before the code compiles