This repository provides a structured approach to learning Rust, with 100 practical programs organized into ten key categories. Whether you're a beginner or looking to deepen your understanding, these exercises will help you build a solid foundation and advance your skills.
- Hello World: Print "Hello, World!" to the console.
- Basic Arithmetic: Perform addition, subtraction, multiplication, and division.
- Swap Variables: Swap the values of two variables.
- Area of a Circle: Calculate the area of a circle given its radius.
- Simple Interest: Calculate simple interest based on principal, rate, and time.
- Temperature Converter: Convert temperatures between Celsius, Fahrenheit, and Kelvin.
- Even or Odd: Check if a number is even or odd.
- Leap Year: Determine if a given year is a leap year.
- Factorial: Calculate the factorial of a number.
- Fibonacci Sequence: Generate the first
n
numbers in the Fibonacci sequence.
- Prime Number Check: Check if a number is prime.
- Palindrome: Check if a string is a palindrome.
- Armstrong Number: Check if a number is an Armstrong number.
- Sum of Digits: Calculate the sum of the digits of a number.
- Reverse a Number: Reverse the digits of a number.
- Greatest Common Divisor (GCD): Find the GCD of two numbers.
- Least Common Multiple (LCM): Find the LCM of two numbers.
- Quadratic Equation Solver: Solve a quadratic equation.
- Pattern Printing: Print various patterns like pyramids and diamonds.
- Binary to Decimal: Convert a binary number to decimal.
- Array Rotation: Rotate an array by
n
positions. - Matrix Addition: Perform addition of two matrices.
- Matrix Multiplication: Perform multiplication of two matrices.
- Transpose of a Matrix: Find the transpose of a matrix.
- Linked List Implementation: Implement a singly linked list.
- Doubly Linked List: Implement a doubly linked list.
- Stack Implementation: Implement a stack using arrays or linked lists.
- Queue Implementation: Implement a queue using arrays or linked lists.
- Circular Queue: Implement a circular queue.
- Binary Search Tree (BST): Implement a binary search tree.
- Bubble Sort: Implement the bubble sort algorithm.
- Selection Sort: Implement the selection sort algorithm.
- Insertion Sort: Implement the insertion sort algorithm.
- Merge Sort: Implement the merge sort algorithm.
- Quick Sort: Implement the quick sort algorithm.
- Binary Search: Implement the binary search algorithm.
- Linear Search: Implement the linear search algorithm.
- Depth First Search (DFS): Implement DFS for graph traversal.
- Breadth First Search (BFS): Implement BFS for graph traversal.
- Dijkstra's Algorithm: Implement Dijkstra's algorithm for the shortest path.
- String Reversal: Reverse a string.
- Count Vowels and Consonants: Count the number of vowels and consonants in a string.
- Anagram Check: Check if two strings are anagrams.
- Substring Search: Find a substring within a string.
- String Palindrome: Check if a string is a palindrome.
- Remove Duplicates: Remove duplicate characters from a string.
- Character Frequency: Find the frequency of each character in a string.
- Longest Substring Without Repeating Characters: Find the longest substring without repeating characters.
- String Permutations: Generate all permutations of a string.
- String Compression: Implement string compression based on character counts.
- Heap Implementation: Implement a min-heap and max-heap.
- Graph Representation: Represent a graph using an adjacency matrix and list.
- Trie Implementation: Implement a trie for prefix-based search.
- Hash Map Implementation: Implement a hash map using open addressing or chaining.
- AVL Tree: Implement an AVL tree for balanced binary search.
- Red-Black Tree: Implement a red-black tree.
- Segment Tree: Implement a segment tree for range queries.
- Fenwick Tree: Implement a Fenwick tree for range queries.
- Disjoint Set: Implement a disjoint set (union-find).
- LRU Cache: Implement an LRU cache using a doubly linked list and hash map.
- Design a URL Shortener: Implement a URL shortening service.
- Design a Library Management System: Design and implement a library management system.
- Design an Online Marketplace: Design an online marketplace system.
- Design a Chat Application: Implement a simple chat application.
- Design a File System: Design and implement a basic file system.
- Design a Rate Limiter: Implement a rate limiting system.
- Design a Key-Value Store: Implement a key-value store.
- Design a Parking Lot System: Design and implement a parking lot system.
- Design a Voting System: Implement a voting system.
- Design a Search Autocomplete System: Implement search autocomplete functionality.
- SQL Queries: Write basic SQL queries to interact with a database.
- CRUD Operations: Implement Create, Read, Update, Delete operations.
- Database Indexing: Implement indexing for a database.
- Transaction Management: Implement transaction management in a database.
- Stored Procedures: Write and execute stored procedures.
- Database Backup and Restore: Implement backup and restore functionality.
- Normalization: Normalize a database to remove redundancy.
- Denormalization: Denormalize a database for performance.
- Database Sharding: Implement database sharding for scalability.
- Database Replication: Implement database replication for fault tolerance.
- Basic HTML Page: Create a simple HTML page.
- CSS Styling: Style a webpage using CSS.
- JavaScript Interactivity: Add interactivity to a webpage using JavaScript.
- Form Handling: Implement form handling in a web application.
- Session Management: Implement session management for user authentication.
- REST API: Design and implement a RESTful API.
- GraphQL API: Design and implement a GraphQL API.
- Authentication: Implement user authentication using JWT or OAuth.
- File Upload: Implement file upload functionality.
- WebSockets: Implement real-time communication using WebSockets.
- Unit Testing: Write unit tests for your code using Rust's
cargo test
. - Integration Testing: Implement integration tests.
- Code Documentation: Document your code using Rust's doc comments.
- Version Control: Use Git for version control.
- Debugging: Practice debugging techniques using Rust's debugging tools.
- Concurrency: Implement concurrency using Rust's async/await and threads.
- Memory Management: Understand and implement Rust's ownership and borrowing system.
- Error Handling: Implement robust error handling using Rust's
Result
andOption
types. - Performance Optimization: Optimize your code for performance.
- Deploy an Application: Deploy your Rust application to a cloud service like AWS or Heroku.