Skip to content

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.

Notifications You must be signed in to change notification settings

CHINMAYVIVEK/rust-practice

Repository files navigation

Rust Practice

10 Steps to Mastering Rust

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.

1. Basic Programs

  1. Hello World: Print "Hello, World!" to the console.
  2. Basic Arithmetic: Perform addition, subtraction, multiplication, and division.
  3. Swap Variables: Swap the values of two variables.
  4. Area of a Circle: Calculate the area of a circle given its radius.
  5. Simple Interest: Calculate simple interest based on principal, rate, and time.
  6. Temperature Converter: Convert temperatures between Celsius, Fahrenheit, and Kelvin.
  7. Even or Odd: Check if a number is even or odd.
  8. Leap Year: Determine if a given year is a leap year.
  9. Factorial: Calculate the factorial of a number.
  10. Fibonacci Sequence: Generate the first n numbers in the Fibonacci sequence.

2. Control Flow

  1. Prime Number Check: Check if a number is prime.
  2. Palindrome: Check if a string is a palindrome.
  3. Armstrong Number: Check if a number is an Armstrong number.
  4. Sum of Digits: Calculate the sum of the digits of a number.
  5. Reverse a Number: Reverse the digits of a number.
  6. Greatest Common Divisor (GCD): Find the GCD of two numbers.
  7. Least Common Multiple (LCM): Find the LCM of two numbers.
  8. Quadratic Equation Solver: Solve a quadratic equation.
  9. Pattern Printing: Print various patterns like pyramids and diamonds.
  10. Binary to Decimal: Convert a binary number to decimal.

3. Data Structures

  1. Array Rotation: Rotate an array by n positions.
  2. Matrix Addition: Perform addition of two matrices.
  3. Matrix Multiplication: Perform multiplication of two matrices.
  4. Transpose of a Matrix: Find the transpose of a matrix.
  5. Linked List Implementation: Implement a singly linked list.
  6. Doubly Linked List: Implement a doubly linked list.
  7. Stack Implementation: Implement a stack using arrays or linked lists.
  8. Queue Implementation: Implement a queue using arrays or linked lists.
  9. Circular Queue: Implement a circular queue.
  10. Binary Search Tree (BST): Implement a binary search tree.

4. Algorithms

  1. Bubble Sort: Implement the bubble sort algorithm.
  2. Selection Sort: Implement the selection sort algorithm.
  3. Insertion Sort: Implement the insertion sort algorithm.
  4. Merge Sort: Implement the merge sort algorithm.
  5. Quick Sort: Implement the quick sort algorithm.
  6. Binary Search: Implement the binary search algorithm.
  7. Linear Search: Implement the linear search algorithm.
  8. Depth First Search (DFS): Implement DFS for graph traversal.
  9. Breadth First Search (BFS): Implement BFS for graph traversal.
  10. Dijkstra's Algorithm: Implement Dijkstra's algorithm for the shortest path.

5. String Manipulation

  1. String Reversal: Reverse a string.
  2. Count Vowels and Consonants: Count the number of vowels and consonants in a string.
  3. Anagram Check: Check if two strings are anagrams.
  4. Substring Search: Find a substring within a string.
  5. String Palindrome: Check if a string is a palindrome.
  6. Remove Duplicates: Remove duplicate characters from a string.
  7. Character Frequency: Find the frequency of each character in a string.
  8. Longest Substring Without Repeating Characters: Find the longest substring without repeating characters.
  9. String Permutations: Generate all permutations of a string.
  10. String Compression: Implement string compression based on character counts.

6. Advanced Data Structures

  1. Heap Implementation: Implement a min-heap and max-heap.
  2. Graph Representation: Represent a graph using an adjacency matrix and list.
  3. Trie Implementation: Implement a trie for prefix-based search.
  4. Hash Map Implementation: Implement a hash map using open addressing or chaining.
  5. AVL Tree: Implement an AVL tree for balanced binary search.
  6. Red-Black Tree: Implement a red-black tree.
  7. Segment Tree: Implement a segment tree for range queries.
  8. Fenwick Tree: Implement a Fenwick tree for range queries.
  9. Disjoint Set: Implement a disjoint set (union-find).
  10. LRU Cache: Implement an LRU cache using a doubly linked list and hash map.

7. System Design

  1. Design a URL Shortener: Implement a URL shortening service.
  2. Design a Library Management System: Design and implement a library management system.
  3. Design an Online Marketplace: Design an online marketplace system.
  4. Design a Chat Application: Implement a simple chat application.
  5. Design a File System: Design and implement a basic file system.
  6. Design a Rate Limiter: Implement a rate limiting system.
  7. Design a Key-Value Store: Implement a key-value store.
  8. Design a Parking Lot System: Design and implement a parking lot system.
  9. Design a Voting System: Implement a voting system.
  10. Design a Search Autocomplete System: Implement search autocomplete functionality.

8. Databases

  1. SQL Queries: Write basic SQL queries to interact with a database.
  2. CRUD Operations: Implement Create, Read, Update, Delete operations.
  3. Database Indexing: Implement indexing for a database.
  4. Transaction Management: Implement transaction management in a database.
  5. Stored Procedures: Write and execute stored procedures.
  6. Database Backup and Restore: Implement backup and restore functionality.
  7. Normalization: Normalize a database to remove redundancy.
  8. Denormalization: Denormalize a database for performance.
  9. Database Sharding: Implement database sharding for scalability.
  10. Database Replication: Implement database replication for fault tolerance.

9. Web Development

  1. Basic HTML Page: Create a simple HTML page.
  2. CSS Styling: Style a webpage using CSS.
  3. JavaScript Interactivity: Add interactivity to a webpage using JavaScript.
  4. Form Handling: Implement form handling in a web application.
  5. Session Management: Implement session management for user authentication.
  6. REST API: Design and implement a RESTful API.
  7. GraphQL API: Design and implement a GraphQL API.
  8. Authentication: Implement user authentication using JWT or OAuth.
  9. File Upload: Implement file upload functionality.
  10. WebSockets: Implement real-time communication using WebSockets.

10. Miscellaneous

  1. Unit Testing: Write unit tests for your code using Rust's cargo test.
  2. Integration Testing: Implement integration tests.
  3. Code Documentation: Document your code using Rust's doc comments.
  4. Version Control: Use Git for version control.
  5. Debugging: Practice debugging techniques using Rust's debugging tools.
  6. Concurrency: Implement concurrency using Rust's async/await and threads.
  7. Memory Management: Understand and implement Rust's ownership and borrowing system.
  8. Error Handling: Implement robust error handling using Rust's Result and Option types.
  9. Performance Optimization: Optimize your code for performance.
  10. Deploy an Application: Deploy your Rust application to a cloud service like AWS or Heroku.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages