




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































You will need to prepare a written document which demonstrates the followings ● Create a design specification for data structures explaining the valid operations that can be carried out on the structures and determine the operations of a memory stack and show how it is used to implement function calls in a computer. ● Illustrates, with an example, a concrete data structure for a First In First out (FIFO) queue and compare the performance of two sorting algorithms. Further, produce an analysis of the operation of the two network shortest path algorithms providing an example of each. P1 Create a design specification for data structures explaining the valid operations that can be carried out on the structures. Introduction As I am one of the software engineers working in this. B2C Pvt Ltd which is a software company that works on projects based on machine learning, artificial intelligence, IOT(internet of Things) etc. Now I am assigned the responsibility to prepare document so as to show your company understands on use of different ADTs, different sorting and searching algorithms, their applications and efficiency. sorting and searching algorithms, their applications and efficiency. Data structure:
“A data structure is a specialized format for organizing and storing data. General data structure types include the array, the file, the record, the table, the tree, and so on. Any data structure is designed to organize data to suit a specific purpose so that it can be accessed and worked with in appropriate ways. In computer programming, a data structure may be selected or designed to store data for the purpose of working on it with various algorithms”[ CITATION Mar19 \l 1033 ]. Data structures used in this case are Singly Linked List, Linked implementation of a Stack, Linked implementation of a Queue. Types of data structures A data type is an attribute of data which tells the compiler (or interpreter) how the programmer intends to use the data. Types of data structures Data structures are divided into two categories, includes, Primitive Data and Non-primitive:
Simple data structure Simple data structure build on data types to create higher level data structures. The most common simple data structures are Array and Linked lists. a. Array The array data structure is one of the oldest and most popular data structures. An array of elements can be values or variables. The structure determines the elements using an index or key, allowing the data structure to calculate the position of each element. The memory address of the original element is called the first platform or address. Data elements are indexed and stored sequentially in adjacent memory. There are different types of array data structures. In a common example, many databases use one-dimensional linear arrays that have database records. Arrays can also be multidimensional if they access elements from more than one index. Arrays are the fundamental structure for many other data structures including hash tables, queues, stacks, and linked lists. b. Linked List Link list is the second most popular data structure type. It links elements instead of computer addresses from pointers. While an array of mathematically computes data entries, linked lists store data items in its own structure. The structure considers each element to be a single object and each object contains data and references or the address of the next element. There are three types of linked lists: singly linked where each node stores the next node’s address and the end address is null, doubly linked where each node stores the previous and next node’s addresses and the end address is null, and circular linked where each node links to the other in a circle, and there is no ending null. Compound data structure Computing systems combine simple data structures to form compound data structures. Compound structures may be linear or non-linear. a. Linear Linear data structure from sequences Stack
A stack is a basic linear data structure: a logical entity visualized as a physical stack or object stack. The data structure inserts and deletes elements at one end of the stack, called vertices. Developers develop a stack using arrays and linked lists. A stack in the order in which the computer system performs operations. The order is usually the first appearance (LIFO). The main activities for the stack include 1) Push, add an item to the stack; and 2) Pop, remove an item from the stack in reverse order to Push. Stack also returns an isEmpty value: it means true on an empty stack and deletes false if there is data. Queue Instead of the stack LIFO order, the queue data structure places elements in the queue in the order of First In First Out (FIFO). The insertion process is called Enqueue, which inserts an element into the back or tail of the queue. The delete procedure is called Dequeue, removing elements from the front or the beginning of the queue. To move the element that is inserted into the Dequeued queue, the stack data structure must remove all elements between the new element and the front of the queue. Think of this structure in line with the printer queue, where print jobs occur in order until they are printed or canceled. A queue can be built using arrays, linked lists or stacks. b. Non-linear Non-linear structures are multi-leveled and non- sequential Graph graph data structure is a tree that shows the mathematical image of an object placed with linked pairs. The object points connected together are vertices and links that are edges. Hash Table The hash converts the main value range into the index range in an array. The hash table data structure links each value in an array with a single index that records the point and insertion position of the value, which speeds up the search and search of data.
provides a way to manage large datasets such as databases or internet indexing services. Is there a need for efficient algorithm design? allowing secure storage of information on your computer. This information can then be used for later use and can be used by various programs. In addition, the information is protected and should not be lost (especially if it is stored on magnetic tape). allowing data to be used and processed on software systems. Enables easier data processing. Using the internet, we can access data at any time from any connected machine (computer, laptop, tablet, phone, etc.) Disadvantages of data structure Only sophisticated users can make changes to the data structure Any problem involving the data structure requires the help of a specialist, which is that basic users cannot help themselves. Discussing over all the possible data sorting like linked list, array, queue, and stack I have point out their use and working principal and it is clear that the role of an array is to store a fixed-size sequential collection of data in programing. But there are 2 bounds that it has:
Instead of using array for the E-shop online Ecommerce online company. I have suggested them to use linked list and produce a short example of how we can sort the huge amount of data using linked list algorithm.
For My company ShopNow I have used LinkedList data types because: Linked List is Dynamic data Structure. Linked List can grow and shrink during run time. Insertion and Deletion Operations are Easier Efficient Memory Utilization, i.e. no need to pre-allocate memory Faster Access time, can be expanded in constant time without memory overhead Linear Data Structures such as Stack, Queue can be easily implemented using Linked list Among LinkedList I would use single LinkedList because: Dynamic Data Structure Linked list is a dynamic data structure so it can grow and shrink at runtime by allocating and deallocating memory. So, there is no need to give initial size of linked list. Insertion and Deletion Insertion and deletion of nodes are really easier. Unlike array here we don’t have to shift elements after insertion or deletion of an element. In linked list we just have to update the address present in next pointer of a node. No Memory Wastage As size of linked list can increase or decrease at run time so there is no memory wastage. In case of array there is lot of memory wastage, like if we declare an array of size 10 and store only 6
In this project, I use linked list for storing data of product. MyOrderQueueT
Fig: Flow chart B2C Pvt Ltd Management System Flowchart diagram for Shop Now online shopping Management System
| MyT
| | return true; Judgements This program has built the implementation of Linked List from the scratch because of its advantages, but also some disadvantage matters are still visible: The size of the linked list is so flexible and almost “infinite” (depending on the computer's memory). Adding or removing from one side of the list is simple because Linked List can grow and shrink during run time. But if adding or removing the node at the middle of the list is more complex than arrays. When user want to access to elements in the linked list, the application need to browse sequentially all element. It slows down the process and takes more time than arrays (Accessing to the elements in the array is accessed directly based on index). The most important advantage of using Linked List in this program is that Linear Data Structures such as Stack, Queue can be easily implemented using Linked list. Coding