Posts

Showing posts from September, 2020

Big O asymptotic analysis/Big O notation

Big O asymptotic analysis/ Big O notation  Big O is one of the most fundamental tools for computer scientists to analyse the cost of an algorithm. Big O notation is used to calculate the runtime of the best, worse and expected case scenario. Big O only cares about the worse case scenario.  This is a way of comparing multiple solutions which solve the same problem, to find out which solution is the most efficient in terms of time and space complexity. For example they are multiple ways to drive to Liverpool football Club however lets choose the way that is quickest (time complexity) and is least stressful so it takes up less head space for the driver (space/memory complexity).  Time Complexity  How long does the algorithm take to complete? In the worse case scenario how long will it take to complete this algorithm?  The execution time  of a task in relation to the number of steps required to complete it. Example: Quick Sort Worse case= O(N2) - the pivot kee...
Notifications/Cloud Messaging Step 1: Call Firebase Function from native app/web app to send a notification Call firebase function from: Android App Call firebase function from: Web App Part one Part Two Step 2: The Firebase function to send a notification/cloud message to all users: Step 3 - The 3 states: (1)Background, (2)Not running and (3)in the app Tap on notification and open an activity/alert with data when app is in the background or not running Receiving notification when app is in the background: By default notification shows on device notification list. Receiving notification when is not running: By default notification shows on device notification list. Applies to background and not running state When the firebase function fires, it needs to return data (shown above - messageData) which will allow you to access the information to display in your app. -------------------------------------------------------------------------------------------...