Basic Concepts of Sorting and Searching
The insurance company intends to computerize their records. Customers can purchase life and education insurance policies for their children. The customer base of the company currently stands at 200, and the company expects growth of no more than 10% over the following decade. In total there are 200 customers, of which 150 have life insurance, and the rest have education insurance. Customer information includes name, address, contact information, age, health condition record, beneficiary information, and yearly payment schedule for life insurance policies. To maintain the education policy, the system needs to maintain the name of the customer, the address, contact information, the child’s age, the policy’s type, and the child’s name. This insurance company wishes to develop these processes into a management system, so that task data can be easily stored and updated. There will be detailed information in the following sections, focusing primarily on the planning, and design sections of the insurance policy management and tracker system. The report will begin with a brief overview of the background information that will be necessary to successfully design the system. The next section will discuss the case study and the design of the system. Finally, the report will conclude with a conclusion.
The development of the tracking system requires an understanding of the basic concepts of sorting and searching, as discussed in the above section. Any time you need to sort a great deal of data you will need to use the most frequently used sort, namely a merge sort. While insertion sort is extremely important when entering data into the system, if a value needs to be added to the array list that is already sorted, this is not a feasible option. Last but not least, the binary search is one of the most commonly used algorithms in order to search any item and retrieve information from the system. This can then be used to update any particular data into the system.
Merge Sort – Merge sort is a sorting technique that uses the divide and conquer strategy. It is one of the more popular and efficient sorting algorithms, dividing the given list into two half, calling itself for each half, and finally merging the sorted halves. Each sub-list is divided into halves several times until there are no more halves to divide. Next, we merge the two-element lists, sorting them as we do so[1]. Once the two-element pairs have been sorted, they are merged to form four-element lists, and so on until we have the sorted list. It is same as the divide and conquer strategy[2]. In the Divide and Conquer approach, one can divide a problem into subproblems and build solutions for each subproblem separately[3]. Once the solutions to the subproblems are ready, we combine their results to solve the main problem. Let us assume a subproblem in sorting an array A would be to sort a subset that starts at index p and ends at index r, called A[p..r]. In dividing section, by splitting the subarray A[p..r] into A[p..q] and A[q+1, r], we can achieve the same result as splitting the subarray A[p..r]. As part of the conquer step, it can again be divided both these subarrays and again attempt to sort them[4]. If the furrent form are not yet at the base case, it is then divided repeatedly. As soon as the conquer step reaches the base step for array A[p..r], two sorted subarrays A[p..q] and A[q+1, r] for array A[p..r]is created by creating a sorted array A[p..r] by combining two sorted subarrays A[p..q] and A[q+1, r].
Merge Sort
Insertion Sort – A sorting algorithm that is easy to implement and is very simple is insertion sort. The concept is very close to that of sorting playing cards, where the selected card is compared to its previous cards[5]. It is done until all of the cards have been sorted. If they are smaller than the selected card, the smaller card is swapped, otherwise the next card in the row is checked. Furthermore, once a card has been checked and placed in the correct place, it is considered to be sorted[6]. Next, another card will be selected from the unsorted section, which will also be checked to be placed in the sorted part.
Binary Search – Binary searches work primarily based on divide and conquer rule based algorithms. They are also known as half interval search algorithms. It basically divides the data into half then checks the middle value of each two-part set[7]. Basically, if the value (middle position) is less than the data to be searched, it searches for segments left of the value in the leftward direction[8]. If the value (middle position) is more than the data to be searched, the algorithm searches by leftward division. Until all the elements in the list have been searched for the data to be searched or until all the data is found, this process continues[9]. In addition, a certain prerequisite must also be met in order for the binary search algorithm to work correctly; namely, the list must be arranged in ascending order before beginning the process.
The insurance company intends to computerize their records. Customers can purchase life and education insurance policies for their children. The customer base of the company currently stands at 200, and the company expects growth of no more than 10% over the following decade. In total there are 200 customers, of which 150 have life insurance, and the rest have education insurance. Customer information includes name, address, contact information, age, health condition record, beneficiary information, and yearly payment schedule for life insurance policies. To maintain the education policy, the system needs to maintain the name of the customer, the address, contact information, the child’s age, the policy’s type, and the child’s name. Following are four sections that will describe how to develop the tracking section, starting with describing the varied types of variables, ranges, and keys that will actually be used. On the following part, the operations and their uses and management will be discussed along with the underlying logic and processes for each operation. Once the operations have been fully reviewed, the algorithm functionality and processes will be discussed. In the last part, any other modifications may be discussed due to an increase in data. Conversely, if no modifications are needed to the sections proposed, the reasons for not making changes will be discussed.
In order to perform any task related functions, the details of the customers must be stored. The details of all the personnel must be stored in the insurance company system by declaring variables so that similar types of information can be kept together in a single list. As a result, even if arrays do the trick[10], declaring their size beforehand is also required in order to declare them; consequently, a lot of storage is taken up even if they are not used. The system may also give errors when crossing the mentioned limit and not provide updates after that point. For this reason, array lists can be used as an alternative to make the process dynamic in order to utilize only the necessary memory space for the added functionality and the ease of handling data additions and manipulations[11]. There will be a list of arrays for each variable that may be needed to store the data. The most common variables will be those about the customers and the insurance details together with a common set of variables so that everything may be referenced collectively.
Insertion Sort
Customer information includes name, address, contact information, age, health condition record, beneficiary information, and yearly payment schedule for life insurance policies. When a customer purchases an education policy, the following information must be kept in the system: name, address, contact information, age, child’s name, and policy type. Lastly, a set of details will also be noted in order to handle all these together so that they can be linked. These details will mostly relate to information about a customer’s information and insurance and claim records.
For the tracking system to function properly, it will perform two basic functions; sorting and searching. For the sorting purpose, the most common sort, i.e. merge sort is necessary when sorting large amounts of data at any time. The insertion sort is very much essential when entering data into the system, on the other hand, when inserting a single value into the already-sorted array list. In addition, binary search is the most common way of searching for data within the terminal system, whether it be in order to retrieve specific information from the system, or rather to update data therein.
As was explained in the previous sections, the merge kind will primarily take place after a large amount of data has been inserted at any given time.
Merge Sort:
In the following section merge sort is detailed[12]:
MergeSort (array [ ], L, right)
If R > L, then
- The middle point of the array is determined by dividing it into two equal halves:
M = ( L + R ) / 2
- For the first half of the section, call MergeSort:
Invoke MergeSort ( array, L, M)
- For the second half, call MergeSort:
Invoke MergeSort ( array, M + 1, R)
- Combining the two halves after sorting has been completed in steps 2 and 3:
Merge and return the merged array by invoking the function Merge (array, L, M, R)
Binary Search:
The operation for the binary searching algorithm is detailed as follows[13]:
- Defining an array list inside of which sorted array values are to be stored
- Next, declare another variable bottom to store the lower value position data and allocate zero to it
- Next, declare another variable top to sore the upper limit value data and allocate it with the size length of the array list
- Now, declare another variable var to copy the value or data that is to be searched from the current array list.
- As long as the variable var data is not found or does not matches with the contents in the array list, the following sections needs to be repeated:
Load mid = ((top – bottom) / 2 )+ bottom
If arrList [mid] = var, then
return mid value and get out of the current loop
If arrList [mid] < var, then
Load , bottom = mid + 1
If arrList [mid] > var, then
Load top = mid – 1
If the value of top < bottom, then
Return -1 value and get out of the current loop.
When the last condition has been met and a -1 is returned from the return section, the program recognizes that the details searched for the current searching operation are not present in the formerly stored array list and displays appropriate messages for the same situation.
Toward the end of the case scenario, it states that even if data quantities were increased from 200 to 4000 customers, i.e. twenty types more than was initially thought, the current structured system would not require any additional modifications. Thus, the tracking system will function normally without any issues. That is, for the suggested increment of the customer, identical tracking systems will be utilized without any problems[14]. Since, each ArrayList will contain each type of data, hence for every data; the lists can hold more than two billion fields[15]. Moreover, ArrayLists works with dynamically allocating memory space[16], no extra space will be consumed and the system will work smoothly without any problem.
Conclusion
A lot of people work in the insurance company performing the daily tasks and handling the management on a regular basis. Their current plan is to develop a tracking system for their management tasks, so they can manage their dealings quickly and efficiently by using a database to make fast transactions as well as processing. This will enable them to easily and quickly implement the system based on the structure in the report. Using the detailed structure will also make it possible to implement the system more easily and efficiently. The end result is that it will benefit the insurance tracking system a great deal in tracking all insurance dealings and processing. In this report, sorting and searching processes are detailed which will allow them to accomplish the required task easily even if their customer base increases twenty folds from what it currently is.
Reference:
- Lobo, J., & Kuwelkar, S. Performance analysis of merge sort algorithms. In 2020 International Conference on Electronics and Sustainable Communication Systems (ICESC)(pp. 110-115). IEEE. 2020.
- Huang, X., Liu, Z., & Li, J. Array sort: an adaptive sorting algorithm on multi-thread. The Journal of Engineering, 2019(5), 3455-3459. 2019.
- Araujo, I. F., Park, D. K., Petruccione, F., & da Silva, A. J. A divide-and-conquer algorithm for quantum state preparation. Scientific Reports, 11(1), 1-12. 2021.
- Zhao, T. F., Chen, W. N., Kwong, S., Gu, T. L., Yuan, H. Q., Zhang, J., & Zhang, J. Evolutionary divide-and-conquer algorithm for virus spreading control over networks. IEEE transactions on cybernetics. 2020.
- Faro, S., Marino, F. P., & Scafiti, S. Fast-Insertion-Sort: a New Family of Efficient Variants of the Insertion-Sort Algorithm. In SOFSEM (Doctoral Student Research Forum)(pp. 37-48). 2020.
- ŠI, F. S. A., & Martin, T. O. M. Lean Formalization of Insertion Sort Stability and Correctness. Acta Electrotechnica et Informatica, 18(2), 42-49. 2018.
- Sun, X., Hu, C., Lei, G., Yang, Z., Guo, Y., & Zhu, J. Speed sensorless control of SPMSM drives for EVs with a binary search algorithm-based phase-locked loop. IEEE Transactions on Vehicular Technology, 69(5), 4968-4978. 2020.
- Fitrian, R. M., Taufik, I., Ramadhan, M. S., Mulyani, N., Hutahaean, J., Sitio, A. S., & Sihotang, H. T. Digital Dictionary Using Binary Search Algorithm. In Journal of Physics: Conference Series(Vol. 1255, No. 1, p. 012058). IOP Publishing. 2019.
- Muhamad, W. Z. A. W., Jamaludin, K. R., Saad, S. A., Yahya, Z. R., & Zakaria, S. A. Random binary search algorithm based feature selection in Mahalanobis Taguchi system for breast cancer diagnosis. In AIP Conference Proceedings(Vol. 1974, No. 1, p. 020027). AIP Publishing LLC. 2018.
- Shi, L., Zheng, G., Tian, B., Dkhil, B., & Duan, C. Research progress on solutions to the sneak path issue in memristor crossbar arrays. Nanoscale Advances, 2(5), 1811-1827. 2020.
- López, M. A., Duarte, E. V., Gutiérrez, E. C., & Valderrama, A. P. Teaching based on ludic environments for the first session of computer programming-Experience with digital natives. IEEE Revista Iberoamericana de Tecnologias Del Aprendizaje, 14(2), 34-42. 2019.
- Zhang, J., & Jin, R. (2020, December). In-Situ Merge Sort Using Hand-Shaking Algorithm. In International conference on Big Data Analytics for Cyber-Physical-Systems(pp. 228-233). Springer, Singapore.
- Liu, J. P., Yu, C. Q., & Tsang, P. W. Enhanced direct binary search algorithm for binary computer-generated Fresnel holograms. Applied optics, 58(14), 3735-3741. 2019.
- Jurinová, J. Performance improvement of using lambda expressions with new features of Java 8 vs. other possible variants of iterating over ArrayList in Java. Journal of Applied Mathematics, Statistics and Informatics, 14(1), 103-131. 2018.
- Sara, M. R. A., Klaib, M. F., & Hasan, M. Hybrid Array List: An Efficient Dynamic Array with Linked List Structure. Indonesian Journal on Computing (Indo-JC), 5(3), 47-62. 2020.
- Charatan, Q., & Kans, A. The Java Collections Framework. In Java in Two Semesters(pp. 427-468). Springer, Cham. 2019.ger, Cham. 2019.