Cmm570 Unit 1 Assignment

495 Words2 Pages
CMO570 Report 1. Item and Customer data are stored in a hashPublic Map getCustomers() { return customers;} Public Map getItems(){return items;} When you search for a key/value pair in a hash table you can go directly to the location that contains the item you want, you rarely have to look at any other items, you can just look at the key and go directly to the location where it is stored. Hash maps allow the execution time of basic operations, such as get() to remain constant even for large sets. HashSets and HashMaps are implemented using a data structure known as a hashtable. ‘The concept of a hash table is a generalized idea of an array where key does not have to be an integer. We can have a name as a key, or for that matter any object as…show more content…
A Linked List is made up of a chain of nodes, linked lists are slow when it comes to random access however they are fast for inserts and deletes anywhere in the list as you can update a few next and previous pointers of a node. A Linked List is a common way of storing an array, a major benefit of a Linked List is that you don’t specify a fixed size therefore the more elements you add to the chain, the bigger the chain gets. This is ideal for the storing of data within our program as we have a take orders method which will add an order to the array each time. An alternative to a Linked List is an Array List. Linked Lists and Array Lists both implement a list interface. They both maintain the elements insertion order which means while displaying Array List and Linked List elements the result set would be having the same order in which the elements got inserted into the list. Their methods and results are almost identical, however there are a few differences between them. The search of an Array List operation is fast in comparison to a Linked List, this is because an Array List maintains an index based system for its elements as it uses array data structure implicitly which makes it faster for searching an element in the

More about Cmm570 Unit 1 Assignment

Open Document