Day 37/366
vishal.codes
Posted on May 7, 2024
š Today's Learning:
š DSA
- Greedy algorithm to find minimum number of coins
- Valid Paranthesis Checker
š Dev
- Benefits of NodeJS
š Some Key Highlights:
DSA
The greedy algorithm for finding the minimum number of coins works by iteratively selecting the largest coin denomination that is less than or equal to the remaining amount needed to make change. It continues this process until the remaining amount becomes zero. At each step, it selects the largest possible coin denomination, ensuring the minimum number of coins is used to make the change.
A valid parenthesis checker algorithm works by iterating through each character in the given string representing parentheses. It utilizes a stack data structure to keep track of the opening parentheses encountered. When an opening parenthesis is encountered, it is pushed onto the stack. When a closing parenthesis is encountered, it checks if the stack is empty or if the top of the stack contains the corresponding opening parenthesis. If either condition is not met, the parentheses are not valid. After processing all characters, if the stack is empty, the parentheses are valid; otherwise, they are not.
DEV
Node.js offers several benefits for developers. Firstly, it allows for asynchronous, event-driven programming, which is particularly useful for handling I/O operations efficiently. This means Node.js can handle a large number of concurrent connections without blocking, making it ideal for building real-time applications like chat applications or streaming services. Secondly, Node.js utilizes JavaScript, a language familiar to many developers, both on the front end and the back end. This allows for code reuse and easier collaboration between front-end and back-end teams. Additionally, Node.js has a vast ecosystem of libraries and packages available through npm (Node Package Manager), which speeds up development by providing ready-to-use solutions for common tasks. Finally, Node.js is lightweight and scalable, making it suitable for building microservices architectures and deploying applications to cloud platforms. Overall, Node.js offers flexibility, performance, and a thriving community, making it a popular choice for building modern web applications.
#100daysofcode #1percentplusplus #coding #dsa
Posted on May 7, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.