Skip to main content

Posts

Showing posts with the label Algorithms

Featured Post

Salesforce Agentforce Specialist Certification: What It Takes in 2026

 With Agentforce now central to Salesforce's roadmap, demand for people who can actually configure, ground, and govern AI agents has spiked — and Salesforce's certification track has changed to match. If you're weighing whether to get certified in 2026, here's what the credential actually covers and whether it's worth your time. The Certification Landscape Changed in 2026 Salesforce retired the older AI Associate and AI Specialist certifications in early 2026. The current credential is the Salesforce Certified Agentforce Specialist (exam code AI-201 ) — a single, more practical exam replacing the older, more theory-focused ones. What the Exam Actually Tests Rather than abstract AI theory, the Agentforce Specialist exam focuses on real configuration and governance skills: Designing AI workflows using prompts, actions, data, and automation. Grounding agents with relevant, trustworthy data. Building and customizing agents for specific business needs. I...

Binary Search Explained Step by Step (with JavaScript Code)

 Binary search is usually the first "real" algorithm people learn in DSA, and for good reason: it's simple, it's fast, and it teaches the core idea behind a huge number of more advanced algorithms — solve a big problem by repeatedly cutting it in half. The Problem It Solves You have a sorted list of numbers and you want to know if a target value exists in it (and where). The naive approach — checking every element one by one — is O(n) . Binary search does it in O(log n) , which is dramatically faster for large lists. How It Works Look at the middle element of the list. If it matches the target, you're done. If the target is smaller, repeat the search on the left half. If the target is larger, repeat the search on the right half. Keep going until you find it, or the range becomes empty (not found). Every step throws away half the remaining list — that's why it's so fast. Searching 1,000,000 sorted items takes at most ~20 comparisons. Java...

Sorting Algorithms Explained: Bubble Sort, Merge Sort & Quick Sort

 Sorting is one of the most common problems in computer science, and interviewers love it because it's a great window into how you think about trade-offs. Here are the three sorting algorithms you'll run into most often, explained simply, with working JavaScript code. 1. Bubble Sort — The Simplest One Bubble sort repeatedly walks through the list, comparing neighbors and swapping them if they're in the wrong order. Bigger values slowly "bubble" toward the end. function bubbleSort(arr) { const a = [...arr]; for (let i = 0; i < a.length; i++) { for (let j = 0; j < a.length - i - 1; j++) { if (a[j] > a[j + 1]) { [a[j], a[j + 1]] = [a[j + 1], a[j]]; // swap } } } return a; } console.log(bubbleSort([5, 3, 8, 1, 2])); // [1, 2, 3, 5, 8] Time complexity: O(n²) — easy to understand, but too slow for large lists. Mostly used for teaching, not production. 2. Merge Sort — Divide and Conquer Merge sort splits the...