Skip to content

This is a repository for rust users, who want to solve difficult challenges in rust.

License

Notifications You must be signed in to change notification settings

ghimiresdp/rust-raid

Repository files navigation

Rust Raid

Rust Raid is a repository for Rust learners and coding challenge seekers.

The repository contains solutions to diverse challenges categorized by different topics(workspaces). Each workspace contains multiple binaries so that it will be easier to run specific problem by selecting binaries.

You can run the cargo run --bin <binary_name> to run binaries.To run all test cases, you can run cargo test command, or to run specific test, you can run cargo test --bin <binary_name>

# Example: running binary for huffman encoding
cargo run --bin huffman
cargo test --bin huffman
  1. Arrays
  2. Singly Linked Lists
  3. Doubly Linked Lists cargo run --bin doubly_linked_list
  4. Stacks cargo run --bin stack
  5. Queues cargo run --bin queue
  6. Binary Trees cargo run --bin binary_tree
  7. Segment Trees
  8. Fenwick Trees (Binary Indexed trees)
  9. Suffix Trees
  10. Trie
  11. Disjoint Set
  1. Linear Searching cargo run --bin linear_search
  2. Binary Searching cargo run --bin binary_search
  3. [Depth First Search (DFS)]
  4. [Breadth First Search (BFS)]
  1. bubble sort cargo run --bin bubble_sort
  2. selection sort cargo run --bin selection_sort
  3. insertion sort cargo run --bin insertion_sort
  4. quick sort cargo run --bin quick_sort
  5. [Merge sort]
  6. [heap Sort]
  7. [Counting Sort]
  8. [Radix Sort]
  1. [Activity Selection]
  2. Huffman Coding cargo run --bin huffman
  3. Krushkal's algorithm cargo run --bin kruskal
  4. [Prim's Algorithm]
  5. [Dijkstra's Algorithm]
  6. [Bellman-Ford Algorithm]
  7. [Floyd-Warshall Algorithm]
  8. [Topological Sort]
  9. [A* Search Algorithm]
  1. Singleton Pattern cargo run --bin singleton
  2. Factory Pattern cargo run --bin factory
  3. Builder Pattern cargo run --bin builder
  4. Decorator Pattern cargo run --bin decorator
  5. Observer Pattern cargo run --bin observer
  6. Strategy Pattern cargo run --bin strategy
  7. Command Pattern cargo run --bin command
  8. Adapter Pattern cargo run --bin adapter
  1. Practical Number cargo run --bin practical_number
  2. Greatest Common Divisor cargo run --bin gcd
  3. Median cargo run --bin median
  4. Reverse digits of the integer cargo run --bin reverse_integer
  5. List Comprehension cargo run --bin comprehension
  6. Linear Regression Model cargo run --bin linear_regression
  7. Matrix Multiplication Model cargo run --bin matrix_multiplication
  8. Color Converter cargo run --bin color_converter
  1. List group by consecutive numbers cargo run --bin consecutive_groups
  2. Find the length of the longest substring with maximum 2 repetitioncargo run --bin repeat
  3. Find the index of 2 numbers in an array whose sum equals to the provided target cargo run --bin two_sum
  4. Minimize the Sum from an array cargo run --bin minimize_sum
  5. Fibonacci Series cargo run --bin fibonacci
  6. Longest Common Subsequence cargo run --bin lcs
  7. Coin Change Problem cargo run --bin coin_change
  8. Palindrome Partition cargo run --bin palindrome_partition
  1. Python's Pandas like dataframe container cargo run --bin pandas
  2. ruscrypt basic encryption cargo run --bin ruscrypt

Note: Topics that do not contain hyperlinks are work in progress and will be updated as soon as the solution gets completed.

You can also create a PR with solution/enhancement to each topics.

Running binaries

To run any binary, you can run the command cargo run --bin <bin_name>

Example:

cargo run --bin practical_number

Note: Binary names might not always be the name of the file. Sometimes, a shorter version of the solution name is used to make easier to type. You can see the name of binary in the respective README.md file or the docstring of the respective solution. some examples of shorter version of solution name are as follows:

  • The binary for huffman_coding.rs is just huffman.

Testing

There are test cases for each functions/challenges which will be beneficial for you to learn testing as well as test programs for errors.

To test programs, you can run cargo test command.

Example:

cargo test

# alternatively, to test individual binary, you can run
cargo test --bin your_program_name

About

This is a repository for rust users, who want to solve difficult challenges in rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages