標籤列表

演算法

共有 16 篇文章

  • [Data Structures] Binary Search Trees

    約 4 分鐘

    In this article, we'll dive into the fundamentals of Binary Search Trees (BST), a powerful data structure that organizes data for efficient insertion, search, and traversal operations. Starting from the basic concepts, we’ll explore the recursive call stack, how to insert and search for values, and cover multiple traversal methods, including depth-first (in-order, pre-order, post-order) and breadth-first traversals. By the end, you’ll understand BST operations and have the code to create and manipulate a Binary Search Tree in JavaScript.

  • [Algorithms] Max Stock Profit

    約 1 分鐘

    In this article, we’ll walk through the Max Stock Profit algorithm, which helps determine the maximum profit achievable from buying and selling a stock in a single day based on its changing prices. This common algorithm problem often appears in technical interviews and requires a mix of array handling and optimization techniques.

  • [Algorithms] Merge Sort

    約 1 分鐘

    In this article, we’re covering Merge Sort, an efficient sorting algorithm that breaks down arrays into smaller parts, sorts them, and merges them back into a single sorted array. Merge Sort is often highlighted in technical interviews, so understanding its mechanics is essential.

  • [Algorithms] Bubble Sort

    約 1 分鐘

    In this article, we’ll dive into Bubble Sort, a straightforward sorting algorithm often encountered in coding interviews. We’ll discuss how it works, go through an example, and examine a JavaScript implementation of the algorithm.

  • [Algorithms] Sieve Of Eratosthenes

    約 1 分鐘

    Discover the Sieve of Eratosthenes — an efficient algorithm to find all prime numbers up to a given limit. We'll cover the steps involved, optimizing runtime, and breaking down the code for a clear understanding.

  • [Algorithms] Fibonacci vs. Memorized Fibonacci

    約 2 分鐘

    In this post, we'll explore two different implementations of the Fibonacci sequence: the classic recursive version and an optimized version using memoization. Both methods generate the same result, but their efficiency is quite different, especially when dealing with large numbers.

  • [Algorithms] Binary Search

    約 1 分鐘

    Binary Search algorithm is a fundamental technique in computer science. It's widely used in various applications and is a common topic in technical interviews. Understanding binary search is crucial because it offers a fast way to find values in sorted lists.

  • [Algorithms] Two Sum

    約 2 分鐘

    The Two Sum problem is a popular coding challenge that involves finding pairs of numbers in an array that add up to a specific sum. This is a great problem to practice your problem-solving skills and reinforce your understanding of hash tables for improving time complexity.

  • [Algorithms] Mean Median Mode

    約 1 分鐘

    Learn how to calculate the mean, median, and mode of a number array in JavaScript with a reusable, functional approach. We’ll split the task into easy-to-follow steps that make this algorithm both efficient and beginner-friendly!

  • [Algorithms] Reverse Array In Place

    約 1 分鐘

    Learn how to reverse an array in place with this efficient, space-saving technique. In this post, we’ll explore swapping elements directly within the original array without creating a new one, practicing some key array manipulation skills along the way. Perfect for those looking to level up their JavaScript skills!

  • [Algorithms] Reverse Words in a Sentence

    約 1 分鐘

    Today, we’re tackling the Reverse Words algorithm! This is a fun little challenge where we take a sentence, flip each word individually, and put the sentence back together—no messing with the word order, just reversing each word. Let’s dive in!

  • [Algorithms] Caesar Cipher

    約 1 分鐘

    The algorithm we'll explore in this post is the Caesar Cipher. This classic encryption technique shifts each letter in a string by a specified number of places in the alphabet.

  • [Algorithms] Is Palindrome

    約 1 分鐘

    The 'Is Palindrome' algorithm checks whether a string reads the same forward and backward, ignoring spaces and punctuation. It's a simple yet classic algorithm that can be easily implemented with JavaScript string and array manipulation.

  • [Algorithms] Harmless Ransom Note

    約 1 分鐘

    In this post, we'll break down a common algorithm question you might see in coding interviews: the Harmless Ransom Note. It’s a great example to understand how to manipulate strings and use objects as hash tables for performance improvements. Plus, it’s relatively straightforward but offers a solid practice in understanding time complexity.

  • [Algorithms] Time Complexity & Big O Notation

    約 2 分鐘

    Hey there, fellow coders! Today, we're diving into a concept that's super important for anyone who writes algorithms: Big O notation. It helps us understand how an algorithm performs as the size of its input grows. Think of it as a way to measure the efficiency of our code. Let’s break it down into bite-sized pieces, along with some relatable examples.

  • [Algorithms] Fizz Buzz

    約 1 分鐘

    Fizz Buzz is often the very first algorithm people learn. It's a classic and fundamental concept, serving as an entry point into algorithm learning — simple yet fun!