When would using an ordered array be preferred over using an ordered array?

Review understanding and the ability to use arrays.

Part 1 Use pseudo code to describe your add, remove, find, and display options.

Part 2 Answer the following questions

1. What are the inefficiencies associated with using an unordered array if duplicates are not allowed?

2. What are the advantages of using an ordered array?

3. When would using an ordered array be preferred over using an ordered array?

4. Define Big-Oh notation. Explain how z and c in the definition relate to the evaluation of algorithm efficiency.

5. Why does computer science often describe algorithms in terms of lg instead of ln?

6. How do you convert ln(x) to lg(x)?

7. Give an example of algorithm with Big-Oh values of: N2, N lg N, 1, and N.

8. Why is Big-Oh 2N represent an algorithm called intractable?
9. How much slower would a linear search be on 1024 items than 16 items?

10. How much slower would a binary search be on 1024 items than on 16 items?

Instructions

1. For all our labs, use the Eclipse IDE. On your own computer, you will need to install MinGW. You will also need to download and install the C development toolkit (CDT). There are many tutorials on the Web to step you through this process. Eclipse is a popular IDE for C development; it includes a good interactive debugger and project control

2. Write a C program that will maintain a list of employees using either ordered or unordered arrays. Each employee in the list should store an identifier number (integer), a name (String – char array), and a salary (Double). Allow operations to add, remove, display single, display list, reset the list, create a initial list with randomly populated items, help, and exit.

3. You can choose either an unordered list or an ordered list for your implementation. If you choose an unordered list, sort it before display. For an ordered list, use a binary search instead of a linear search.

4. You don’t need to implement a GUI for this project. Just create a menu of selections as listed below:

Employee Maintenance

1) Add Employee

2) Remove Employee

3) Display Employee

4) Display Employee List

5) Reset List

6) Create Initial List

7) Sort

8) Help

9) Quit

Please Select:

Note: The sort option is unnecessary if you implement an ordered list.

5. To add an employee, randomly pick an integer employee number that must be unique. The C function rand() can be used. A list of available employee numbers must also be maintained. Initially, this list can be filled with a sequential list of integers. To add a new employee, randomly pick one of these integers and replace its entry in the list with the final entry. Ask the user for an Employee name and salary. Keep track of the number of item numbers that are available using an integer counter.

6. When you remove an employee, the employee number should be returned to the free list.

7. Make sure to validate that the salary is within a reasonable range. You can use the C scanf function. Recall that scanf(“%s*”) is needed to clear the input buffer after an error. Always output appropriate error messages when the user types in something illegal. Robust programs should never crash.

8. My implementation contained three files; one for the main program (lab1.c), one for the list of employees (EmployeeList.c), and one for maintaining each employee (Employee.c). I also created a header file (empstructs.h), which contained a structure for the employee items and various symbolic constants (see below).

Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.

Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.

[order_calculator]