I am entering university to study computer science this upcoming fall, which means I now have to start thinking about applying for internships! This means I need to learn data structures and algorithms, but there are hundreds upon thousands of videos...
Basic Definition Data - refers to raw facts and figures (may not have any meaning)→ It is used in computation after processing. It has the following types : Primitive: int – Integer values (e.g., …, -1, 0, 1,…) float – Decimal numbers (e.g., -5.4...
Prerequisite Knowledge: JavaScript fundamentals. Object-Oriented JavaScript. Data Structures and Algorithms. A stack is an important construct in Data Structures and computer programming in general. The compiler uses it for syntactic analysis, a...
稀疏陣列 Sparse Matrix是一個用來存取有需多空值陣列的解決方法。 解決的問題: Sparse Matrix可以將一個包含許多0的2 dimension array 轉換為只要存取不為0的欄位,這樣可以省下許多的空間。 優點: 要找到array中非0的資料比較快 要找到array中特定value的資料比2 dimension array快 2 dimension array需要找到所有非0資料的方法為 $O(n^2)$,Sparse Matrix為 $O(n)$ 缺點: S...
In many array or linked list problems, we are often required to find or compute a specific value across all contiguous subarrays (or sublists) of a given size. A classic example of this is the Sliding Window Maximum problem, where we need to determin...
[PART 2] Intermediate Data Structures and Algorithms Introduction: Reaching the Pinnacle of DSA Mastery You’ve navigated through the basics and conquered intermediate concepts. Now, it’s time to dive into the advanced realm of DSA, where optimization...
1. Opposite Direction (Two-pointer from Ends) ✅ Use When: You need to find pairs in a sorted array. You need to check if a string/array is a palindrome. You are finding an optimal solution between two boundaries (like maximum area, min/max sum). ...
When it comes to searching for an element in a sorted array, two popular algorithms often come up: Binary Search and Interpolation Search. While both are efficient compared to linear search, they work in fundamentally different ways. Let’s break them...
Breadth-First Search (BFS) is a fundamental graph traversal algorithm that explores nodes level by level. It is commonly used for finding the shortest path, network broadcasting, and solving various graph-related problems. Understanding BFS BFS start...
[PART - 1] Beginner’s Guide to Data Structures and Algorithms Introduction: Leveling Up Your DSA Knowledge Congratulations! You’ve tackled the basics of DSA. Now it’s time to delve deeper into more complex data structures and algorithms. In this blog...