Inventory System Design for Household and Food Items: Report

Verified

Added on  2022/11/22

|13
|2620
|389
Report
AI Summary
This report presents the design of an inventory system for a company dealing with household and food items. It explores the use of data structures such as linked lists for data insertion, deletion, and update operations. The report analyzes suitable algorithms, including merge sort for sorting and binary search for searching, considering both initial and expanded datasets after a company merger. It discusses the associated variables, keys, and ranges for data storage and outlines the operations involved, such as inserting, deleting, updating, and displaying items. Furthermore, the report suggests implementing a database with an interactive user interface for improved data management, scalability, and security, emphasizing the use of JDBC for database connectivity and indexing for efficient searching. It concludes by highlighting the benefits of the proposed algorithms and database approach for handling large datasets and improving overall system performance.
Document Page
Running head: DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
Name of Student
Name of university
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
DATA STRUCTURE AND ALGORITHMS
Table of Contents
Introduction:...............................................................................................................................2
Associated variables, keys and ranges:..................................................................................3
Operations involved in an Inventory system:.........................................................................4
Suitable Algorithms for the operations:.................................................................................5
Proposed changes:......................................................................................................................8
Conclusion:................................................................................................................................9
References:...............................................................................................................................10
Document Page
2
DATA STRUCTURE AND ALGORITHMS
Introduction:
The inventory system is associated to retail industry, to manage an inventory system
proper operations are required (Vrat 2014). Inventory systems are used in business,
education, manufacturing, etc. to maintain a stock level (Muller 2019). This system helps in
maintaining the details of the items involved, items could be product details, supplier details,
count of materials price of material, etc. In this report designing of an inventory system is
focused. The company that requires the inventory system deals with the products of two
types, which are food items and household items. The estimated quantity of the household
items is 300 and the estimated quantity of the food items is 200 items for recording the items.
The relevant information that are stored in the inventory are product type, price of the
product, details of the manufacturer for house hold items and expiry date of the food items.
Later due to the dealing with another company the number of products got increased. Some
changes would be required such as suitable algorithm for handling the large set of data. And
which other operations are required for handling the large set of data. Altogether, the total
number of products for household items is approximately 25,000 and the number of food
items has increased to 1500. Therefore, for handling the operations involved in the existing
system is a little different from the operations involved in larger dataset.
Document Page
3
DATA STRUCTURE AND ALGORITHMS
Associated variables, keys and ranges:
Two classes need to be created for maintaining the inventory one household_items
and another one for food_items. And the associated variables for household items are:
Product id, product type, product name, product price, product manufacturer. The associated
variables for household items are: Product id, Product type, product name, product price,
product manufacturer, expiry date. For each product there should be unique product id hence,
foodproduct_id and product_id has been added as a variable for both the classes of
food_items and household_items repectively and the key will be primary key or unique key.
The range of the variables that has been set can be used if there are 200 or 300 items.
Household_items
Variables Data type Keys Range
Product_id Integer Primary 10
Product_name string Not null 30
Product_type String Not null 20
Product_price Integer Not null 20
Product_manufacturer String Not null 20
Food_items
Variables Data type Keys Range
foodproduct_id Integer Primary 10
Product_name string Not null 30
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
DATA STRUCTURE AND ALGORITHMS
Product_type String Not null 20
Product_price Integer Not null 20
Product_manufacturer String Not null 20
Expiry_date date Not null -
Operations involved in an Inventory system:
The operations that Inventory should support are as follows:
Insert, for filling up the records linked list
Delete, if deleting record is necessary linked list
Update, if any modification required linked list
Searching for items
Displaying all the items in the stock
To check the stock available.
The mentioned operations can be implemented in the inventory system, the admin can
be able to handle the system accordingly. To keep the track of every items in the stock data
insertion is required. If some product supply not available then deletion can be done.
Modification the dataset, searching for a particular item, etc. all these operations can be
handled in an inventory system.
Document Page
5
DATA STRUCTURE AND ALGORITHMS
Suitable Algorithms for the operations:
Linked List for data insertion and deletion for both the classes of houselhold_item and
food_items. The operations that are involved in the inventory system can be easily handled
with the linked list as insertion and deletion operation can be run efficiently. There is no need
of extra memory hence, efficient memory utilization is involved (Parmar and Kumbharana
2015). The access time that is needed for any operation can be reduced by using Linked list
(Hong et al. 2016). Linked list can be used for both the classes during data insertion. The
time complexity in singly-linked list during worst case is O (1) and the worst case scenario
for doubly linked list have O (1) time complexity.
Algorithm of linked list for data insertion:
Step1: A “household_item” class is created, under which the variables are declared
Step2: Declaration of the variables using in the function of class household_item
public class household_item( int product_id, string product_name, string
product_type, integer product_price, string product_manufacturer)
Step3: For inserting the values pointer will point to the next new node and data will
be inserted.
Algorithm of linked list for deleting any item such as chips from food_items :
Step1: function delete (string chips)
Step2: pointer is declared for the particular item and also for the previous item in the
list
Step3: if the item is found then the item is deleted, if current.item id = particular item;
Document Page
6
DATA STRUCTURE AND ALGORITHMS
Step4: the selected item is deleted
For Sorting:
Merge sort can be used to do the sorting of the list. In merge sort is generally used for
sorting a linked list. It works faster than any other algorithm, the list is divided into two parts
and the advantage of using merge sort is the large data set can be easily handled by using this
sorting algorithm (Woźniak et al. 2013). Merge sort will provide an efficient operation even
if there is same value or elements in the list. It is an external algorithm and divide and
conquer strategy is applied. It’s time complexity of is O (n log n) and one more is NOT O
(log n). Since this inventory system is dealing with many number of data the merge sort will
be efficient.
For Update:
To do the modification in the linked list Stack implementation can be done. For the
approach of Stack, firstly the list of items is partitioned the starting point of the second part of
the linked list is searched and then all the elements or values are pushed into the stack then
each item or element is traversed till the end (Dodds, Haas and Kirsch 2015). While
traversing, if the selected item is found then modified. Using stack in a linked list is easy
because all the processes of accessing is done on the top of the stack. The time complexity for
the worst case is O (1) because in stack implementation push, pop is Empty and size.
For Displaying:
To display the entire list of the table that is present in the inventory system can be
done using the linked list. Additional function is required such as displayList() then for
displaying every objects of the table by using a particular function.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
DATA STRUCTURE AND ALGORITHMS
To check the stock available in the Inventory system:
For this operation, linear search algorithm would be sufficient. Linear search is used
for simple search, which maintains the sequential order for searching each item one by one.
Since searching of each item or element is involved, it can help viewing the entire list or
select part of the list (Friedman, 2018). As an instance, how many product are there with
product price of $200 is needed to be searched. Then traversing with the help of linear search
algorithm over 200 or 300 number of items would not be issue. The time complexity for the
worst case scenario during searching is O (n).
To handle larger data set after collaboration:
To deal with large set of data Linked list is still efficient, the operations of insertion
and deletion can be done using the linked list. As it is a dynamic data structure the operations
can be implemented efficiently. Even if the data set is larger then also linked list is useful,
any data can be inserted in any position of the list. The rearrangement of the data is done
easily and the linked list can be doubly linked list. And if the rearrangement is possible then
update operation of the inventory system can also be done.
For sorting:
Document Page
8
DATA STRUCTURE AND ALGORITHMS
After merging of the company the inventory system have maintain a large data set of
around 25000 and more hence using Quick sort algorithm would be efficient. In quick sort
the strategy of divide and conquer is used and the mechanism of the quick sort is as follows,
first the entire list of the item is divided equally according to the pivot element of the list
(Mehlhorn 2013). After the partition of the data or list, the smaller elements than the pivot
element are on one side and another set consist of the items that are greater than pivot
element. For this sorting algorithm there is requirement of addition al storage hence, runs
effectively. On average case the time complexity required is O (n log n) and for worst case it
takes O (n2).
To check the stock available in the Inventory system and displaying the entire list:
For this operation Binary Search algorithm can be used since the list is sorted with the
Merge sort algorithm. Binary Search works on the sorted list hence, after sorting the list this
algorithm can be used (Chadha et al. 2014). With the help of Binary Search, pointer can be
traversed in the increasing order and even in decreasing order any time. One more advantage
is data can be searched even in range such as find the product price of range $100 to $200.
Binary Search can be implemented faster as its best suitable algorithm. The time complexity
for the worst case scenario during searching is O (log n). This algorithm is beneficial for both
the operation of displaying the entire list as well as checking the stock available.
Document Page
9
DATA STRUCTURE AND ALGORITHMS
Proposed changes:
To maintain a large amount of data set with huge items, using a database at the
backend process would be easier to handle. For the betterment of the process for handling
new system using interactive user interface would be efficient. Firstly, the database is needed
for the creation of the table of household item and food item in which associated attributes
would be present and the proper algorithm using java can be used for data insertion, deletion,
in case, any update required and other operations. The interactive user interface would be
consisting buttons which would require a single click and for each button back end algorithm
would be there.
As an instance, the admin need to insert a data then clicking on “Insert” button after
that data is filled accordingly and the associated database would get filled accordingly. The
back end process requires the connection of jdbc or java application with the database.
Mysql-connector consists of “jars” which is need to be loaded and setting of the class-path is
required. After that login for admin is needed as maintaining the inventory should be handled
by the admin.
The benefit of using this method is there is data security and on-demand scalability. It leads
to high performance. JDBC is an application program interface for java programming it
provides for methods of necessary queries that are needed for the database (He et al. 2013).
The database table can be indexed which will help in sorting and searching.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
10
DATA STRUCTURE AND ALGORITHMS
As an instance, a customer wants to search for a product type and associated price
therefore, then required data is shown as well as frequently bought products can be shown as
recommendation which can be done with the database. This process is done with data
fetching from the tables.
Conclusion:
The inventory system is helpful in maintaining a stock, to handle the huge number of
stock, inventory system provides better tracking or recording the data of items. In this report
the original system was dealing with less number of data and algorithms that were used was a
little different from the larger dataset. For proper handling, better algorithm should be present
and some recommendations are suggested in this report for enhancing the new system after
the merging of Companies. The benefits of using these algorithm are easier handling of data,
maintaining the order of the dataset, etc. The appropriate algorithm have been used for each
operation.
Document Page
11
DATA STRUCTURE AND ALGORITHMS
References:
Chadha, A.R., Misal, R. and Mokashi, T., 2014. Modified Binary Search Algorithm. arXiv
preprint arXiv:1406.1677.
Dodds, M., Haas, A. and Kirsch, C.M., 2015. A scalable, correct time-stamped stack. ACM
SIGPLAN Notices, 50(1), pp.233-246.
Friedman, J., 2018. An algorithm for finding best matches in logarithmic expected time (No.
SLAC-PUB-1549). SLAC National Accelerator Lab., Menlo Park, CA (United States).
He, G.L., Wu, S. and Yao, J.P., 2013, April. Application of design pattern in the JDBC
programming. In 2013 8th International Conference on Computer Science & Education (pp.
1037-1040). IEEE.
Hong, B., Kim, G., Ahn, J.H., Kwon, Y., Kim, H. and Kim, J., 2016, September.
Accelerating linked-list traversal through near-data processing. In 2016 International
Conference on Parallel Architecture and Compilation Techniques (PACT) (pp. 113-124).
IEEE.
Mehlhorn, K., 2013. Data structures and algorithms 1: Sorting and searching (Vol. 1).
Springer Science & Business Media.
Muller, M., 2019. Essentials of inventory management. HarperCollins Leadership.
Parmar, V.P. and Kumbharana, C.K., 2015. Comparing Linear Search and Binary Search
Algorithms to Search an Element from a Linear List Implemented through Static Array,
Dynamic Array and Linked List. International Journal of Computer Applications, 121(3).
chevron_up_icon
1 out of 13
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]