Interactive learning platform for beginners to advanced students. Learn programming, algorithms, data structures, and more with hands-on exercises.
// Binary Search Implementation
function binarySearch(arr, target) {
let left = 0;
let right = arr.length - 1;
while (left <= right) {
const mid = Math.floor((left + right) / 2);
if (arr[mid] === target) {
return mid; // Found the target
} else if (arr[mid] < target) {
left = mid + 1; // Search right half
} else {
right = mid - 1; // Search left half
}
}
return -1; // Target not found
}
// Example usage
const numbers = [1, 3, 5, 7, 9, 11, 13];
console.log(binarySearch(numbers, 9)); // Output: 4
Modify the factorial function to handle negative numbers by returning an error message.
Learn the basics of programming with JavaScript, Python, or Java.
Master essential CS concepts for technical interviews.
Design scalable distributed systems for senior engineers.
Completed "Recursion Basics" lesson
2 hours ago
Solved "Binary Tree Traversal" challenge
Yesterday
Started "System Design Fundamentals" course
3 days ago
Quick reference guides for common programming concepts and syntax.
Comprehensive video courses with hands-on coding exercises.
Practice questions and mock interviews for technical interviews.
Ask questions, share projects, and get feedback from a community of passionate computer science students and professionals.
Active community of learners
Get help anytime
Study groups, hackathons, and more