DEV Community

vishal.codes
vishal.codes

Posted on

Day 16/366

🚀 Today's Learning:

🌟 DSA

  • Segregate 0s and 1s in an array
  • Display the Longest Name

🌟 Dev

  • CI/CD

🔍 Some Key Highlights:

DSA

Segregate 0s and 1s in an array →

For segregating 0s and 1s in an array, you can iterate through the array, maintaining two pointers, one at the beginning and one at the end. While the pointers haven't crossed each other, if the element at the beginning pointer is 0 and the element at the end pointer is 1, swap them. Keep advancing the pointers until they meet, ensuring all 0s are on the left and all 1s are on the right of the array.

Display the Longest Name →

For displaying the longest name, you can iterate through the list of names, keeping track of the longest name encountered so far. Start with an empty string as the longest name, then iterate through each name in the list, comparing its length with the length of the current longest name. If a name is longer, update the longest name variable. After iterating through all names, you'll have the longest name, which you can then display.

DEV

Continuous Integration and Continuous Deployment (CI/CD) is a software development practice where code changes are automatically built, tested, and deployed frequently. In CI, developers integrate their code changes into a shared repository multiple times a day. Each integration triggers automated builds and tests to detect any issues early in the development process. Once the code passes all tests, it's automatically deployed to a testing environment in CD. Continuous Deployment takes it a step further by automatically deploying the code to production after passing all tests in the testing environment. This ensures that software is consistently developed, tested, and deployed, allowing for faster feedback loops and more reliable releases.

#100daysofcode #1percentplusplus #coding #dsa

Top comments (0)