LeetCode 1188. Design Bounded Blocking Queue

Problem Description The problem asked us to imlement a thread safer bounded blocking queues with following methods. Constructor enqueue dequeue size The implementation will be tested under multi-threaded condition. Each thread will either be a producer (calling enqueue) or a consumer(calling dequeue). Intuition C++ offers us multiple ways of implementing the thread safe mechanism. The Conditional variable and the mutex locks can be a Approach Complexity Code Our solution using condition variable and mutex can be seen below.

LeetCode 169. Majority Element

This problem asked us to return the majority elements that appears more than [n/2] times. The problem itself is not that hard to complete with hash table or sorting algorithms. The intuition behind this problem can be understood as to find the frequency of each element in the given array and return the most frequent element. The table below summarize the space and time complexity of these algorirthms. Algorithm Time Complexity Space Complexity Hash Table O(N) O(N) Sorting O(N) O(N) However, the follow-up question asked us to solve the problem in linear time O(n) and constant space O(1).

Lotka Volterra System Tracking with Kalman Filter

Abstract This article investigates the Kalman filter and its sub-variant algorithms’ performance on a Lotka-Volterra System tracking. This article reviews the system model built by the Lotka-Volterra equation. The concept of Kalman Filter, Extended Kalman Filter and Unscented Kalman Filter is demonstrated, and their modified algorithms are presented. We compare the performance of these algorithms using MSE, RMSE, Tracking Results and Processing Time. We showed that under the same performance level in our system, the EKF offers a more stable and fast-tracking solution.