$25
COP 2500 Concepts in Computer Science
Homework #2
Question#1: The goal of this assignment is to familiarize you with JavaScript programming
and basic algorithms of computer science (40 points).
1. Create a HTML page with a button on it, and with click on it ask the user to input n
(Integer)
2. loop n times and ask the user to enter integer and store it in an array
3. Implement a sort algorithm to sort n integers (without using sort() method of array).
4. Print sorted array in the output.
Question#2: The goal of this assignment is to familiarize you with JavaScript programming
and basic algorithms of computer science (40 points).
1. Consider another button in the same HTML page
2. With click on it, ask user to enter an integer m.
3. Implement the binary search function to search m in the sorted array.
4. Show result with proper message ( number found or not)
Source for Data structure and algorithms in JavaScript:
Data Structures and Algorithms with JavaScript by:
(You can find free online pdf version for education purpose).