View full-text article in PMC Sensors (Basel). 2019 Mar 8;19(5):1184. doi: 10.3390/s19051184 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 2 Dynamic context matching algorithm. Input Context DynamicContext,PrivacyContext Output The closest pc of the API call Begin similarity=0 result=null for all pc∈PrivacyContext do if pc.api==DynamicContext.api then simTemp=Similarity(DynamicContext.stack,pc.context) //Calculate similarity if similarity<simTemp then similarity=simTemp result=pc// Update result else if similarity==simTemp then result.add(pc)// Add result end if end if end for return result