Skip to content

COSC3020/asynchronous-functions-DojeeDev

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asynchronicity

Implement a function that takes an array and a key to search for and counts the number of times key matches an element in the array (the count matches function we talked about in lectures). Your implementation must count the number of matches asynchronously, but does not need to do so in parallel. What type of asynchronous execution you choose is up to you.

I have not provided a template; depending on how you choose to implement the function, it will have a different signature.

I have also not provided any test code, but you can base yours on test code from other exercises. Your tests must check the correctness of the result of running the function and run automatically when you commit through a GitHub action.

The async library may be helpful with this.

Runtime Analysis

What is the time complexity of your implementation (worst-case $\Theta$)? Add your answer, including your reasoning, to this markdown file.

Analysis

Since comparisons take constant time and we consider n elements of the array the complexity is $\Theta(n)$

I certify that I have listed all sources used to complete this exercise, including the use of any Large Language Models. All of the work is my own, except where stated otherwise. I am aware that plagiarism carries severe penalties and that if plagiarism is suspected, charges may be filed against me without prior notice.

About

cosc3020-spring2025-asynchronous-functions-async created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%