Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

319 total results found

Referensi Lebih Lanjut

Internet of Things Module 8 - Power Management

Penggunaan mode-mode sleep dalam kode belum dibahas secara terlalu detail dalam modul ini, silahkan refer ke Light Sleep untuk mempelajari penggunaan light sleep dan Deep Sleep untuk mempelajari penggunaan Deep Sleep pada kode. Referensi Lainnya: “Power Manag...

1. Introduction to Searching

Alprog - Elektro KKI Module 7: Searching & Sorting

1.1 What is Searching? Searching is the process of finding a particular element or checking if an element exists in a data structure (array, linked list, tree, etc.). Real-World Analogies: Finding a book in a library Searching for a contact in your phone Look...

2. Linear Search

Alprog - Elektro KKI Module 7: Searching & Sorting

2.1 Concept Linear Search (also called Sequential Search) checks every element in the array sequentially until the target is found or the end is reached. How it works: Start from the first element Compare each element with the target If match found, return th...

3. Binary Search

Alprog - Elektro KKI Module 7: Searching & Sorting

3.1 Concept Binary Search is a fast search algorithm that works on sorted arrays by repeatedly dividing the search interval in half. Prerequisites: Array must be sorted Random access to elements (arrays work well) How it works: Compare target with middle el...

4. Introduction to Sorting

Alprog - Elektro KKI Module 7: Searching & Sorting

4.1 What is Sorting? Sorting is the process of arranging elements in a specific order (ascending or descending). Why Sort? Faster Searching: Enables binary search Data Organization: Makes data easier to understand Algorithm Requirements: Many algorithms requi...

5. Simple Sorting Algorithms

Alprog - Elektro KKI Module 7: Searching & Sorting

5.1 Bubble Sort Concept Bubble Sort repeatedly steps through the list, compares adjacent elements, and swaps them if they're in the wrong order. How it works: Compare adjacent elements Swap if in wrong order Repeat for all elements After each pass, largest el...

6. Efficient Sorting Algorithms

Alprog - Elektro KKI Module 7: Searching & Sorting

6.1 Merge Sort Concept Merge Sort is a divide-and-conquer algorithm that divides the array into halves, recursively sorts them, and then merges the sorted halves. Divide and Conquer Strategy: Divide: Split array into two halves Conquer: Recursively sort each ...

7. Comparison of Sorting Algorithms

Alprog - Elektro KKI Module 7: Searching & Sorting

7.1 Performance Summary // Test all sorting algorithms #include <time.h> void testSortingAlgorithms() { int sizes[] = {100, 1000, 10000}; for (int s = 0; s < 3; s++) { int n = sizes[s]; printf("\n=== Array Size: %d ===\n", n); ...

8. Practical Applications

Alprog - Elektro KKI Module 7: Searching & Sorting

8.1 Search and Sort Combined #include <stdio.h> #include <stdlib.h> #include <string.h> // Student structure typedef struct { int id; char name[50]; float gpa; } Student; // Compare functions for sorting int compareByID(const void *a, const void ...

1. Main Concept of Hash Map

Algorithm Programming Module 7 - Hash Map

Hashing is the process of converting data of any size (like a string, number, or object) into a fixed-length integer value. This integer value is called a "hash value," "hash code," or simply "hash." The primary data structure that uses this concept is called ...

2. Collision Handling

Algorithm Programming Module 7 - Hash Map

A Collision occurs when two or more different keys produce the same hash value (index). For example, "Budi" and "Dina" are both hashed to row #5. We can't overwrite Budi's data. We must have a strategy to handle this. 2.1. Separate Chaining This is the most c...

3. Load Factor and Rehashing

Algorithm Programming Module 7 - Hash Map

3.1. Load Factor (λ) The Load Factor (λ) is a measure of how full the hash table is. It is a critical metric for performance. Formula: λ = m/n n = total number of items stored in the table. m = total size of the hash table (number of buckets). Impact on Pe...

4. Example: Full Manual Implementation

Algorithm Programming Module 7 - Hash Map

This chapter combines all the concepts from Chapters 2 and 3 into a single, complete MyHashMap class. This class handles insertion, searching, deletion, and automatic rehashing. 4.1. Manual Implementation Using Separate Chaining #include <iostream> #include <s...

5. Hashing Implementation with C++ STL

Algorithm Programming Module 7 - Hash Map

In C++, instead of creating a Hash Table manually, you could use Standard Template Library (STL). The STL implementation automatically handles hash functions, collisions, and rehashing when the load factor gets too high. 5.1. std::unordered_map (Key-Value) std...

6. Custom Struct Keys

Algorithm Programming Module 7 - Hash Map

A notable limitation of the C++ STL's std::unordered_map and std::unordered_set is their inability to natively support user-defined types (such as a struct or class) as keys. An attempt to instantiate a map with a custom struct, as shown below, will result in ...

9.1 Learning Objectives

Internet of Things Module 9 - IoT Platforms, Blynk, and Re...

Understand Blynk as a cloud-dependent IoT platform for mobile control and monitoring Implement basic control using Blynk's virtual pin system for LED switching Understand Node-RED as a flow-based visual programming tool for IoT integration Create basic...

9.3 Blynk Tutorial

Internet of Things Module 9 - IoT Platforms, Blynk, and Re...

Setup Blynk Go to Blynk Official Website Sign Up for a new account and login Once you get redirected to Blynk Console, go to Developer Zone > My Templates and click the "New Template Button" Give the project name and description (optional) After ...

9.5 Node Red Tutorial

Internet of Things Module 9 - IoT Platforms, Blynk, and Re...

Node Red Setup In this tutorial, I am using a Linux terminal in Windows (WSL) for simplicity, if you're using other environment, that is fine too but some steps might be a little bit different, so be ready to adapt. Install Node and NPM sudo apt update s...