data structures using in librarythe information about books can be sorted alphabetically based on titles and then by authorsnames customersaddresses can be sorted based on the name of the city and then the street note data records can be sorted based on property such component or property is called sort key sort key can be defined using two or more sort keys in such casethe first key is called the primary sort keythe second is known as the secondary sort keyetc consider the data records given belowdepartment salary phone number janak name telecommunications raj computer science aditya electronics huma telecommunications divya computer science now if we take department as the primary key and name as the secondary keythen the sorted order of records can be given assalary phone number divya name computer science department raj computer science aditya electronics huma telecommunications janak telecommunications observe that the records are sorted based on department howeverwithin each department the records are sorted alphabetically based on the names of the employees practical considerations for internal sorting as mentioned aboverecords can be sorted either in ascending or descending order based on field often called as the sort key the list of records can be either stored in contiguous and randomly accessible data structure (arrayor may be stored in dispersed and only sequentially accessible data structure like linked list but irrespective of the underlying data structure used to store the recordsthe logic to sort the records will be same and only the implementation details will differ when analysing the performance of different sorting algorithmsthe practical considerations would be the followingnumber of sort key comparisons that will be performed number of times the records in the list will be moved best case performance worst case performance average case performance stability of the sorting algorithm where stability means that equivalent elements or records retain their relative positions even after sorting is done bubble sort bubble sort is very simple method that sorts the array elements by repeatedly moving the largest element to the highest index position of the array segment (in case of arranging elements