Inventory System Design for a Company: DSAA204 Data Structures Report

Verified

Added on  2022/11/09

|13
|2800
|337
Report
AI Summary
This report details the design of an inventory system for a company dealing with household and food items. It explores the variables, keys, and ranges necessary for the system's database, considering both initial and expanded scales. The report outlines the essential operations the inventory should support, including insertion, deletion, updating, and searching of products. It analyzes appropriate algorithms for these operations, such as insertion sort and binary search for the initial system, and quick sort and interpolation search for a larger system. The report also discusses the use of balanced binary search trees for efficient insertion and deletion. Furthermore, it addresses scalability challenges and recommends changes to the system when the company merges and handles a much larger volume of products.
Document Page
Running head: DATA STRUTURES AND ALGORITHMS
DATA STRUCTURES AND ALGORITHMS
Name of the Student
Name of the 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
1DATA STRUCTURES AND ALGORITHMS
Executive Summary
The report deals with the designing of an inventory system. The company here deals in
products of two types; household items and food items, there are 300 household items, and
200 food items that the company needs to keep record of. The report focuses on the variables,
keys and the ranges to be used in the system. The report discusses about the operations that
the inventory can support. The report focuses on the searching and the sorting algorithms that
the inventory system should support. Last but not the least; the report has a detailed
discussion about the changes for the larger system to be made in the original inventory
system.
,
Document Page
2DATA STRUCTURES AND ALGORITHMS
Table of Contents
Introduction................................................................................................................................3
Discussions.................................................................................................................................3
Business Scenario...................................................................................................................3
Variables, Keys and Ranges...................................................................................................3
Operation in the Inventory.....................................................................................................5
Algorithms for operations......................................................................................................5
Changes for larger system......................................................................................................7
Conclusion..................................................................................................................................8
References..................................................................................................................................9
,
Document Page
3DATA STRUCTURES AND ALGORITHMS
Introduction
The report deals with the designing of an inventory system. The company here deals
in products of two types; household items and food items, there are 300 household items, and
200 food items that the company needs to keep record of. The report focuses on the variables,
keys and the ranges to be used in the system. The report discusses about the operations that
the inventory can support. The report focuses on the searching and the sorting algorithms that
the inventory system should support. Last but not the least; the report has a detailed
discussion about the changes for the larger system to be made in the original inventory
system.
Discussions
Business Scenario
The company deals in products of two types that are food items and the household
items. There are roughly 200 food items and 300 household items that the company needs to
keep the record. The products are stored with relevant information in the system that includes
type of the product, name of the product, price of the product, product manufacturer for the
household items and expiry for the food items. Later the company has a merger with another
company. Together they have products with around 25,000 household items and 1500 food
items.
,
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
4DATA STRUCTURES AND ALGORITHMS
Fig1. Inventory operations.
Variables, Keys and Ranges
An inventory system should have a database where the name of the products and the
other credentials will be recorded and a user experience where the user will do all the
controls. The database should have different variables, keys and the range should be enough
to hold the number of items.
The different variables for the household items are the product ID, product type,
product name, product price and the product manufacturer. For food items, the variables are
product ID, product type, product name, product price, product manufacturer and expiry. The
product type will hold the type of product that the inventory has. Product name will specify
the name of the product, product price will specify the amount of the product, and product
manufacturer will have the name of the manufacturer. For food items, product type will have
,
Document Page
5DATA STRUCTURES AND ALGORITHMS
the type of the product, product name will have the name of the product, product price will
have the price of the product, product manufacturer will have the name of the manufacturer
and expiry will have the expiry date for the food items.
The keys that can be used for the products in the inventory system in primary key can
be product ID for both the household items and food items (Brown and Link 2016). It can
take as a unique identifier for each of the household items and the food items. The product ID
is unique for the household items and the food items.
The data type must be different for different entities of the household items and the
food items (Jukic, Vrbsky and Nestorov 2016). For household items, the product ID will have
integer data type, product type will have varchar data type, product name will have varchar
data type, product price will have integer data type, and product manufacturer will have
varchar data type. For food items, the product ID will have integer data type, product type
will have varchar data type, and product name will have varchar data type, product price will
have integer data type, product manufacturer will have varchar data type and expiry will have
date data type.
For household items, the range of product ID is 10, for product type the range is 20,
for product name the range is 30, for product price the range is 20, product manufacturer will
have a range of 20.
For food items, the range of product ID is 10, for product type the range is 20, for
product name the range is 30, for product price the range is 20, for product manufacturer the
range is 30 and for expiry, the range can be taken as 10.
Household items
Variable Data type Keys Range
Product ID Integer Primary key 10
,
Document Page
6DATA STRUCTURES AND ALGORITHMS
Product type varchar Not null 20
Product name varchar Not null 30
Product price Integer Not null 20
Product manufacturer varchar Not null 20
Food Items
variable Data type Keys Range
Product ID Integer Primary key 10
Product Type varchar Not null 20
Product name varchar Not null 30
Product price integer Not null 20
Product manufacturer Varchar Not null 30
Expiry Date Not null 10
Operation in the Inventory
Inventory means the stock of the goods that are available or are held for sale in the
course of business (Wild 2017). The inventory consists of raw materials that are stored in a
warehouse, work-in-progress in production, and the gods that are finished and are available
for sale. There are different kinds of operations that an inventory can support. The operations
that the inventory should support are
Inserting the products into the database according to the product ID of the household
items and the food items.
Deleting a product from the database after the product has finished or when the stock has
been cleared.
,
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
7DATA STRUCTURES AND ALGORITHMS
Updating the database with the new products when they are freshly delivered to the
inventory.
Searching a product in the database of the inventory system with the Product ID or the
name of the product.
Algorithms for operations
The operations in the inventory of the business includes inserting of the product in the
database, deletion of products from the database, updating the database with new products
and searching a product in the database.
For inserting the products in the database, an algorithm of insertion sort is required
(Zhao et al 2016). The insertion sort is based on the plan that one of the elements from the
elements that are given as input is consumed in each of the repetition in order to find its right
position that is the place to which the elements or the products belongs in an array that is
sorted.
It repeats the elements that are given as input by growing the array that is sorted at
each of the iteration. The elements are compared that is correct with the value that is largest
in the array that is sorted. If the element that is current is greater, then it leaves the element in
its position and then moves on to the element that is next to it else, it finds its right position in
the array that is sorted and then moves it to that place (Mohammed, Amrahov and Çelebi
2017). This is done by shifting all the elements that is in the array that are larger than the
element that is currently in position, in the array that is sorted to one of the position ahead.
The insertion sort is used to insert the products in the array and it can be used to insert large
amount of numbers in the array. The inventory system can use the insertion sort as it is
simple and it can hold large amount of numbers in the array.
,
Document Page
8DATA STRUCTURES AND ALGORITHMS
Searching is also an important aspect of the inventory. There are large numbers of
products in the inventory (Mussmann and Liang 2018). A searching technique should be used
which can search a product among the number of products in the inventory. The binary
search technique can be used for searching the products in the inventory. The technique of
binary search is taken because it divides the array where the products are being stored in two
parts. The item is searched in the first part then the search stops and then will be returning the
product whether it is available in the inventory or not. If it is not found in the first half then it
is searched in the second part. If the product is found on the second half then it returns the
product that it is available in the inventory. If the product is not found in both the half then
the product is not available in the inventory (Chandramohan et al 2016).
For deletion and insertion of the products, a balanced binary search tree can be used.
A balanced binary search tree that keeps its height small automatically for a sequence of
deletions and insertions (Andersson, Fagerberg and Larsen 2018). These structures provide
implementations that are efficient for the structured of data that are abstract.
Changes for larger system
The company has merged with a larger company and they have products around
25,000 household items and 1500 food items. Now, the products are much more so the
searching and the sorting techniques for the products must be different from that of the
previous one as the products are much more this time. The sorting technique that can be used
for this inventory can be quick sort (Aumüller and Dietzfelbinger 2016). Quick sort is the
fastest sort for large number of elements and in this case product. The reason for taking the
quick sort for this case because it can sort an element faster and it falls in the category of
divide and then conquer approach where it split the array into two parts and then divide the
,
Document Page
9DATA STRUCTURES AND ALGORITHMS
array into two parts. An element is taken as the middle part that is known as pivot and then
the sorting is done. This technique is also known as the partition exchange sort where the lists
of the elements are sorted by partitioning the array. This change can make the searching of
the products in the inventory faster as it takes lesser time than any other sorting technique
(Khreisat 2018).
The binary search technique will not search for the large amount of products in this
case. For large amounts of products, interpolation search can be used, as it is better and, much
faster than the binary search. The interpolation search is a development of the binary search.
Binary search always goes to the middle of the array and check the element to be searched
but in the interpolation search, it can go to various locations according to the value of the key
that is being searched. For example if the product that is to be searched is closer to the last
product, then the interpolation search will start searching the product from the last element
(Rahim et al 2017). This makes the work much faster and easier and the array is not divided
into two parts. It can also be used for large amount of products that is in this case 25,000
household items and 1500 food items (Kaporis et al 2019).
The deletion and the updating the products in the inventory of the large company can
be done using the balanced binary search tree. The balanced binary search trees are very
efficient in the insertion and deletion of the products as it keeps its height small and it provide
implementations that are efficient for the structures of data that are abstract.
Conclusion
The report deals with the designing of an inventory system. The company here deals
in products of two types; household items and food items, there are 300 household items, and
200 food items that the company needs to keep record of. The report focuses on the variables,
keys and the ranges to be used in the system. The report discusses about the operations that
,
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
10DATA STRUCTURES AND ALGORITHMS
the inventory can support. The report focuses on the searching and the sorting algorithms
that the inventory system should support. The searching and the sorting techniques that is
used when the company was s mall is binary search and merge sort that can be used for less
number products. After the company merges with the big company the products becomes
more. Therefore, the searching and the sorting techniques need to be fast and more efficient.
The sorting and the searching techniques that is used in this case is quick sort that is faster
and more efficient for large number of products. The searching technique that can be used is
the interpolation search that is much more efficient than binary search as it searches the
elements by going to various places in the array.
,
Document Page
11DATA STRUCTURES AND ALGORITHMS
References
Andersson, A., Fagerberg, R. and Larsen, K.S., 2018. Balanced binary search trees.
In Handbook of Data Structures and Applications (pp. 151-170). Chapman and Hall/CRC.
Aumüller, M. and Dietzfelbinger, M., 2016. Optimal partitioning for dual-pivot
quicksort. ACM Transactions on Algorithms (TALG), 12(2), p.18.
Brown, P. and Link, S., 2016. Probabilistic keys. IEEE Transactions on Knowledge and Data
Engineering, 29(3), pp.670-682.
Chandramohan, M., Xue, Y., Xu, Z., Liu, Y., Cho, C.Y. and Tan, H.B.K., 2016, November.
Bingo: Cross-architecture cross-os binary search. In Proceedings of the 2016 24th ACM
SIGSOFT International Symposium on Foundations of Software Engineering (pp. 678-689).
ACM.
Jukic, N., Vrbsky, S. and Nestorov, S., 2016. Database systems: Introduction to databases
and data warehouses. Prospect Press.
Kaporis, A., Makris, C., Sioutas, S., Tsakalidis, A., Tsichlas, K. and Zaroliagis, C., 2019.
Dynamic interpolation search revisited. Information and Computation, p.104465.
Khreisat, L., 2018. A Survey of Adaptive QuickSort Algorithms. International Journal of
Computer Science and Security (IJCSS), 12(1), p.1.
Mohammed, A.S., Amrahov, Ş.E. and Çelebi, F.V., 2017. Bidirectional conditional insertion
sort algorithm; An efficient progress on the classical insertion sort. Future Generation
Computer Systems, 71, pp.102-112.
Mussmann, S. and Liang, P., 2018. Generalized binary search for split-neighborly
problems. arXiv preprint arXiv:1802.09751.
,
chevron_up_icon
1 out of 13
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]