Algorithm Design

ALGORITHM CONCEPTS 5

Week one homework


Company Scenario

Jumoyot Company is one of the best companies offering exceptional products to customers through comprehensive management applications. One of these applications is the marketing application that manages customers and products. Marketing strategies are dynamic in every organization due to changing demand and competition. This Company therefore ought to change its marketing management application to have an effective and efficient search algorithm and have an integrated application which can print a sorted list of customers, using a Last-named key.

Applicable Data Structures

The applicable data structures as per the application’s requirements are Linked List data structures and Array data structures. In the former’s applicability, a group of nodes represents a sequence (Mehlhorn & Sanders, 2010). Every node consists of a data and is referred or linked to the next node which also contain another data in the sequence. Each detail of a customer is represented by a given node and linked to the next node containing the product’s details as its data. For example, the following data will be linked by the linked list:

First Name

Last Name

Shipping Address

Billing Address

Phone No.

Customer ID.


Product ID

Name

Description

Wholesale price

Sale price

Inventory



Another best data structure that will work is the Array. The array stores objects of the same or different types. It can also hold primitive data types and references. It has been proved to allow searching and sorting effectively because it contain elements of the same type (Goodrich, Tamassia, & Goldwasser, 2015). The features of the array are: copying and cloning, insertion and deletion; and searching and sorting. Array can be used in implementing other data structures such as strings and list. The array would be the best for Jumuyot Company because large number of data values will be dealt with. This is important because with increase in the number of variables, the complexity of the program also increases (Goodrich, Tamassia, & Goldwasser, 2015). The array will be important in holding the last name of the customers because they are of the same type, i.e. string type. Therefore sorting will be easy since only the program will perform the instruction as programed and output in the desired order.

The data types contained by the information needed to be stored by the data structures makes the applicability of the aforementioned data structures effective. With linked lists, the elements can be inserted or deleted without necessarily reallocating or reorganizing the entire structure (Mehlhorn & Sanders, 2010). This is because there is no need of storing the data item in a contiguous way in memory.

Benefits of Linked Lists

  • With this data structure, nodes can be inserted or removed at any point of the sequence containing various data without altering the entire structure.

  • It is simple to apply compared to other data structures

Limitations of Linked Lists

  • This data structure does not allow random access to data unlike arrays and queues.

  • There is need for thorough scanning the lists elements in order to locate the node containing a given data.

Advantages of Array

  • Array is used to hold element that belong to the same data type

  • The other good about array is that be used to implement other data structures such as link list and queues

Disadvantages of Arrays

  • The elements to be stored should be known in advance

  • Once the memory has been allocated it cannot be changed; array size i9s of fixed size

  • Since the elements are stored consecutively, it is hard to insert or delete the elements in an array.

Recommendation

Linked list is the best data structure Jumoyot Company because attributes of customers and products are of different types. Linked list is able to hold elements of different types. The deletion and insertion of node, which on this case are product or customer, can be done easily (Mehlhorn & Sanders, 2010). Also with linked list it will be possible to search and sort any element easily. Therefore, I would recommend the company to implement linked.



References

Goodrich, M. T., Tamassia, R., & Goldwasser, M. H. (2015). Data structures and algorithms in Java. Singapore: Wiley.

Mehlhorn, K., & Sanders, P. (2010). Algorithms and data structures: The basic toolbox.