Uploaded by Ashen UD

Kugan New

advertisement
1. Data structure and algorithms .......................................................................................... 2
1.1 Introduction ............................................................................................................... 2
1.2 Algorithms, in contrast to programs ....................................................................... 3
1.3 Basic concerns of algorithmic theory ...................................................................... 4
1.4 Books and online materials ...................................................................................... 5
1.5 Overview .................................................................................................................... 6
2.data structure used for the scenario .................................................................................. 7
2.1 kinds of data structures ............................................................................................ 7
2.2 Regular linear data structures: ................................................................................ 7
3.linked list data structure ..................................................................................................... 8
3.1 Linked List................................................................................................................... 8
3.2 Types of Linked List ................................................................................................... 9
3.3 Basic Operations ......................................................................................................... 9
4.Node in linked list q .............................................................................................................. 9
5.Queue data structure ........................................................................................................ 10
5.1. Enqueue ................................................................................................................... 10
5.2. Dequeue ................................................................................................................... 10
6.Implementation ................................................................................................................... 12
6.1 Introduction ............................................................................................................. 12
6.2 Location of Implementation ..................................................................................... 13
6.3 Techniques and Equipment for System Development ........................................... 13
6.3.1 NetBeans IDE 8.2 ............................................................................................ 13
6.3.2 MySQL Workbench 6.3 ....................................................................................... 13
6.3.3 XAMPP Server 3.2.1.1 .................................................................................. 13
6.3.4 The Star of UML 5.0 ..................................................................................... 13
6.4 A Look at the Primary Code Architecture ............................................................. 14
6.4.1 Setup of a Connection to a Database............................................................. 14
6.4.2 Success and Error Messages ........................................................................ 14
7.Testing .................................................................................................................................. 15
1
7.1 An Overview ............................................................................................................ 15
7.2 Software Evaluation versus. Testing ..................................................................... 15
7.2.1 Methodology for Testing Software .............................................................. 15
7.2.2 Analysis of Software Version .............................................................................. 17
7.3 Roadmap for System Testing ................................................................................. 17
8.Sorting .................................................................................................................................. 20
8.1 The Complicated Nature of Sorting Algorithms .................................................. 20
9.quick sort ............................................................................................................................ 20
10.merge sort ........................................................................................................................ 21
11.sorting algorithm- analysis ............................................................................................. 22
12.quick sort vs merge sort ................................................................................................... 23
13. Finding shortest path using dijkstra model ................................................................... 25
14.Finding the shortest path using bellman ford model ..................................................... 25
15.Find the newest to oldest registered participants using abstract data type................. 26
16. Stack abstract data ......................................................................................................... 27
17. Operations in stack .......................................................................................................... 27
18.Review ................................................................................................................................ 29
19.Conclusion ......................................................................................................................... 34
20.Reference ........................................................................................................................... 35
1. Data structure and algorithms
1.1 Introduction
The fundamental concepts of algorithm design are covered in these lecture notes. It will become
clear how their success is tied to the creation of well-suited data structures, and how different
algorithms and designs yield different results. The techniques covered here will be particularly
useful in a few specific areas of computer science, such as data storage, sorting, and searching,
but will have wide-ranging applicability.
First, we'll look at the fundamentals of data structures including arrays, lists, queues, stacks,
2
and trees, and then we'll see how these structures are put to use in various algorithms for
searching and sorting. From here, we can think about ways to make hash tables even more
efficient. Lastly, we'll explore graph-based representations and the methods required to
effectively interact with them. While doing so, we will be looking into the computational
efficiency of the algorithms we create and forming first-hand impressions on the relative merits
of various techniques. In this paper, rather than limiting ourselves to a single programming
language (such as Java, C, or OCaml) for the implementation of the various data structures and
algorithms, we will instead express them in straightforward pseudocode that can be simply
translated into any suitable language.
1.2 Algorithms, in contrast to programs
Specifically, an algorithm is "a finite sequence of instructions, each of which has a clear
meaning and can be performed with a finite amount of work in a finite length of time,"
according to the definition. So, an algorithm needs to be clear enough for human beings to
follow. However, programs need to be written in a strict formal language in order to be
executed by a computer; and as computers are somewhat rigid in comparison to the human
mind, programs typically need to contain more information than algorithms. In this article, we
will not be discussing those specifics of programming, but rather will focus on the algorithmic
side of things, as opposed to the programming side. However, while the actual programming
aspects of putting the mentioned algorithms into computer programs are certainly significant,
they will not be the focus of these notes, which will instead focus on the theoretical
underpinnings. Yet, in order to clarify and test certain theoretical features of algorithms and
their data structures, we will often find it necessary to write down chunks of actual programs.
It's also important to remember that there are various paradigms in computer programming.
Imperative programming, as contrast to declarative programming, specifies computation in
terms of instructions that alter the state of the program or data.
indicates the desired outcomes without providing implementation details. The focus of these
notes will be on building algorithms that can be easily translated into an imperative code base.
It is evident that algorithms can be described in layman's terms, and on occasion we shall do
so. But, computer scientists sometimes find it easier and more clear to employ a not-quiterunnable style of computer program code that lies between standard English and the structured
code they are used to seeing. Pseudocode can take several forms and is used in a wide range of
3
contexts. These notes typically feature snippets of pseudocode that are strikingly close to the
languages we're most interested in, the overlap between C and Java, and which can be
seamlessly integrated into existing, executable code.
1.3 Basic concerns of algorithmic theory
When presented with an algorithm designed to address a certain issue, it's only natural to
wonder: First of all, what is the point of it?
The usual jargon for these three categories is:
1. Particulars
2. Checking.
3. Breakdown of efficiency.
In most cases, the specifics of these three factors will rely heavily on the nature of the problem
at hand. The specification must be a formalization of the most important aspects of the problem
that the algorithm will solve. This may be based on a concrete illustration of the relevant data,
or it may be more conceptual in nature. There is no hard and fast rule that the specification
must be thorough or non-ambiguous, but it should at least detail how the algorithm's inputs and
outputs are connected.
An algorithm is guaranteed to work (i.e., fulfill its specification) for problems of low
complexity. It may not be immediately clear if a given method satisfies a given specification,
especially for increasingly complex specifications and/or algorithms. Here, we have to put in
some time and energy to make sure the algorithm is proper. In many cases, validating the
algorithm only on a small subset of possible inputs is sufficient to demonstrate its failure.
Nevertheless, more than just case-by-case testing is needed to ensure that the algorithm fits its
specification because the number of possible inputs for most algorithms is infinite in theory
and vast in practice. True accuracy proofs are required. Certain proofs and relevant notions like
invariants will be covered in these notes, but only in a casual setting (though, of course, we
will attempt to be rigorous). In this case, it's because we'd like to give our full attention to the
algorithms and data structures. Since formal verification techniques are so intricate, they are
usually studied only after the fundamentals covered in these notes have been mastered.
4
Finally, an algorithm's efficiency or performance is tied to the resources it requires, such as
how quickly it will run and how much computer memory it will take. For the most part, this
will be determined by the scope of the problem instance, the form of data representation
selected, and the specifics of the method. In fact, this is typically what motivates researchers
to create brand new data structures and algorithms. During the rest of these notes, we will be
applying the broad concepts we covered in Chapter 5 on efficiency.
Knowledge of data structures, abstract data types, and design patterns is essential. Being able
to properly organize the data is crucial to developing an effective algorithm for many situations.
In computer science, a data structure is a specific method of arranging data for use in a given
kind of computation. In this paper, we will examine a wide variety of data structures, from the
simple array and list to the more involved tree, heap, and graph, and we will examine how the
data structure's choice influences the efficiency of the algorithms based on it.
It's convenient to discuss data structures without getting bogged down in the specifics of how
they're implemented in different programming languages or where the data is physically kept
in RAM. To achieve this goal, we can use mathematical abstractions to represent specific types
or families of data structures that share certain characteristics. Abstract data types are those
whose only defining characteristic is the set of operations that can be applied to them. Most
algorithms have some fundamental checks to govern the flow of processing, and we typically
specify how they are constructed out of more simple data types (such as integers or strings)
and how to retrieve that data. Encapsulation refers to the practice of shielding implementation
details from view and preventing unauthorized access to them. Throughout these notes, we will
encounter several concrete illustrations of abstract data types.
Design patterns, which explain the creation of algorithms as opposed to data structures, operate
at a still more general level of abstraction. These are essential design principles that are
prevalent in various problem settings and may be used universally. They offer an overarching
framework for algorithms, allowing specifics to be worked out as needed. They can hasten the
creation of algorithms by offering tried-and-true algorithm structures that can be used directly
to new situations. There are a few common layout patterns that will appear repeatedly in these
remarks.
1.4 Books and online materials
5
Although these notes serve as a good introduction to data structures and algorithms, you will
almost probably need to supplement them with additional reading or other resources to gain a
thorough grasp of the subject. These accompanying lectures are meant to help you make sense
of these notes and fill in any gaps that may exist; nonetheless, it is highly doubtful that this will
be sufficient on its own, as it is common to require seeing more than one explanation of a
concept before it clicks.
A universally applicable textbook does not exist. The material covered in these notes is of a
classical nature, thus a more up-to-date textbook would be superfluous. Novels from the last
decade or two still hold up well, and every year brings us even more excellent works of
literature. The reason for this is that all computer science degree programs at universities cover
the same essential foundational subject covered in these notes. Today, the internet is a wealth
of knowledge, with many excellent resources available (even full books that can be
downloaded for free). Going to the library and perusing the sections devoted to data structures
and algorithms is a smart idea. Download, borrow, or purchase one that you want; just make
sure it covers most of the items on the above table of contents. You probably don't need me to
tell you that not everything you read online is genuine, but Wikipedia is a good source of fairly
credible information on all the key topics. It's also important to note that not all sources of
information will be an exact match with each other or with what you find in these notes because
there are often many different good ways to solve the same task, different sensible names used
for the same thing, and different equally-valid conventions used by different people.
1.5 Overview
These notes will survey the most important algorithmic building blocks and data structures in
use today in computer science, synthesizing previously disjointed concepts into a unified
whole. The information we collect will be organized into useful data structures so that our
algorithms can easily and effectively work with it. Algorithm specification, verification, and
performance analysis are all topics that will be covered repeatedly. We'll start by examining
the pros and cons of some common abstract data types and the fundamental data structures that
implement them (including arrays, linked lists, stacks, and queues). After that, we think about
the ever-present searching problem and how it might be used to explain the more abstract
concepts of computational efficiency and complexity. This will equip us to investigate three
crucial data structures: trees (especially binary search trees and heap trees), hash tables, and
6
graphs. We will examine in depth how to create and analyze ever-more-effective procedures
for storing, sorting, searching, and analyzing data, and how to manipulate and perform useful
operations on those structures. The hope is that after reading these notes, the reader will have
enough background knowledge to tackle more advanced issues with relative ease.
2.data structure used for the scenario
2.1 kinds of data structures
What kind of data structure is employed in a given situation is decided by the operations or
algorithms that must be performed. There are two primary types of structures: linear and
nonlinear. The following varieties of data structures can be used:
2.2 Regular linear data structures:
The term "array" is commonly used to refer to a data structure that keeps track of a list or
collection of items. While arrays are most commonly used to hold information in memory, they
can also be used to symbolize connections between different bits of information.
7
Data stacks keep track of a growing list of items, with the most recent addition always at the
top. A stack is an order-preserving data structure that stores data in the order in which
operations are performed. LIFO is the same as FILO, which stands for FIrst in, Last out, and
describes the order in which items are used. The most recently contributed item to a queue is
always placed last in the data structure known as a queue. One way to organize data is in a
queue, which stores items in the order in which they will be processed. First-in, first-out (FIFO)
is the same as Last-in, first-out (LILO) ordering. Data components of any kind are grouped
together in a linked list (also called a list) with each node having a value and linking to the next
in the chain. There are various types of linked lists, such as a circular linked list, a single linked
list, and a double linked list.
3.linked list data structure
3.1 Linked List
Linked List contains a link element called first.
Each link carries a data field(s) and a link field called next.
Each link is linked with its next link using its next link.
Last link carries a link as null to mark the end of the list.
8
3.2 Types of Linked List
Simple Linked List − Item navigation is forward only.
Doubly Linked List − Items can be navigated forward and backward.
Circular Linked List − Last item contains link of the first element as next and the first element
has a link to the last element as previous.
3.3 Basic Operations
Insertion − Adds an element at the beginning of the list.
Deletion − Deletes an element at the beginning of the list.
Display − Displays the complete list.
Search − Searches an element using the given key.
Delete − Deletes an element using the given key.
3.4.Node in linked list q
1. After that, make a class QNode with the fields integer data and QNode*.
2. Constructor that accepts an integer parameter x and initializes data to x, followed by
setting the next variable to NULL.
3. Create a Queue object with some data members. The Two Faces of the QNode
4. Using the x parameter, the enqueue operation is:
5. QNode* temp = data = x to start.
6. If the back is empty, the front and back should be made temporary, and then the code
should return (Base Case)
9
7. Instead, position the rear near the temperature gauge, and then transfer the rear to the
gauge.
8. Procedure for Dequeuing:
9. The front is NULL if the front is null (Base Case)
10. Set the current front to the next front in the QNode's transition table.
11. If both the front and back are NULL, the back should also be NULL.
12. Put temp in the past
3.5.Queue data structure
Discover what a queue is and how it works with this helpful guide. All four major programming
languages (C, C++, Java, and Python) also have their own queue implementations. Among the
many available data structures, a queue is among the most practical. In a similar vein, the first
person in line to purchase a ticket outside a movie theater will be the first person to receive
their order. An item placed at the front of a queue can expect to be removed first. This is known
as the First In First Out (FIFO) rule.
5.1. Enqueue
check if the queue is full
for the first element, set the value of FRONT to 0
increase the REAR index by 1
add the new element in the position pointed to by
5.2. Dequeue
check if the queue is empty
return the value pointed by FRONT
10
increase the FRONT index by 1
for the last element, reset the values of FRONT and REAR to -1
11
6.Implementation
6.1 Introduction
In the SDLC's implementation phase, chosen programming languages and tools are put to use
to create a working version of the product based on the requirements specification. Here, the
12
features that end-users of the system have come to expect are transformed into real-world
applications. The defined functionalities are implemented as a series of modules, and this
process is carried out methodically and in stages.
The system's key code segments and modular structure are outlined in this section.
Furthermore, the hardware and software implementation environment, as well as proper
attributions of the existing programs utilised for the system implementation, are described in
this chapter.
6.2 Location of Implementation
System implementation hardware and software configurations are grouped.
6.3 Techniques and Equipment for System Development
6.3.1 NetBeans IDE 8.2
The project was implemented using NetBeans IDE 8.2. This user-friendly development tool
was used for the swift and efficient completion of all front-end implementation tasks requiring
knowledge of PHP, HTML5, and CSS coding.
Throughout the course of the project's execution, the open-source relational database
management system MySQL was utilized for database management chores, and the
6.3.2 MySQL Workbench 6.3
tool was used for visual database planning and modeling.
6.3.3 XAMPP Server 3.2.1.1
The XAMPP (Cross-Platform Apache HTTP Server MySQL PHP and Perl) software stack is
a free and open-source web server that may be used on multiple platforms. Used for developing
and testing web-based applications, XAMPP's minimal footprint makes it an ideal alternative.
6.3.4 The Star of UML 5.0
The StarUML 5.0.2 open-source UML design tool was used to produce the software
architecture diagrams included in the dissertation.
13
6.4 A Look at the Primary Code Architecture
In this section, we'll go over all the important chunks of code that were put in place during the
Implementation stage to turn the project's anticipated functionalities into a real, usable, and
effective solution.
6.4.1 Setup of a Connection to a Database
In order for the system to work as intended, it is crucial that the database connection that acts
as a bridge between the database and the application be defined. You can see the MySQL
connection string that has been defined to access the "db bae" database in the code snippet
6.4.2 Success and Error Messages
The code segment depicted in Figure 4.2 describes how “Success” and “Error” messages have
been implemented in the code base.
14
7.Testing
7.1 An Overview
When it comes down to it, testing software is more of a wide process that is made up of multiple
interconnected procedures. The fundamental goal of software testing is to evaluate the
software's overall quality and whether or not it fulfills all of the project's essential requirements.
In software testing, we use several techniques to inspect and validate the software. Some
examples of what these procedures are trying to accomplish:
7.2 Software Evaluation versus. Testing
If you want to make a reliable piece of software, you need to have a firm grasp on the evaluation
and testing phases.
7.2.1 Methodology for Testing Software
The purpose of the testing phase of software development is to ensure that the final product
functions as intended. Some of the most common and widely-used approaches to software
testing are described below.
1. Black-Box Testing
Black-box testing is a testing method in which testers intentionally avoid learning about the
application's internals. The tester has no knowledge of the system's architecture and cannot
15
view the code. [15]
With the support of a small group of students who were not familiar with the system's design
and thorough documentation of user inputs, a Black-Box testing technique was successfully
implemented.
2.Blank-Box Testing
White-box testing is an in-depth analysis of the program's internal workings. A white-box tester
examines the inner workings of the code to ensure the program functions as intended. [15]
7.2.1.1 Testing Methods
Several "Levels of testing," or sorts of testing, are available to ensure a software system is fit
for its intended purpose.
1.Unit Testing,
A phase of software testing in which standalone parts of the system are examined. The goal is
to verify that each component of the program works as expected. [16]
2. Tests of Integration
Group testing is a phase of software testing when multiple independent components are used
to simulate real-world usage scenarios. This level of testing is meant to unearth issues with
how different components work together. [16]
3. System Testing,
Tests performed on an entirely functional and integrated software system. This evaluation is
used to check if the system meets the predetermined criteria. [16]
4.Validation of Acceptance
16
Testing a system to determine whether or not it meets certain criteria, typically in the context
of software. This check is meant to determine if the system meets all of the necessary business
criteria and if it can be released without causing any disruptions. [16] At the stage of system
implementation known as "unit testing," tests were conducted on each module as it was being
developed. After system implementation was complete, integration and system testing were
performed to assess whether or not the system met the user requirements gathered in the
Analysis phase.
7.2.2 Analysis of Software Version
To ensure the developed software system is up to snuff with the project's criteria, an assessment
mechanism must be put in place to test the system's performance. Potential users can provide
feedback on the software's usability during the testing phase.
7.3 Roadmap for System Testing
The purpose of a Test Plan is to ensure the quality of a software system in a controlled and
repeatable manner. Having a well-defined test plan and technique can greatly improve the
success rate of finding system flaws and defects. A test plan that has been properly designed
and executed can be used as documentation to support claims about the software's quality.
Table 5.1 displays the high-level testing strategy developed to evaluate and verify the Students
Management System.When it comes down to it, testing software is more of a wide process that
is made up of multiple interconnected procedures. The fundamental goal of software testing is
to evaluate the software's overall quality and whether or not it fulfills all of the project's
essential requirements. In software testing, we use several techniques to inspect and validate
the software. Some examples of what these procedures are trying to accomplish:
17
18
19
8.Sorting
8.1 The Complicated Nature of Sorting Algorithms
The time complexity and space complexity of a sorting algorithm impact how well it performs.
First, we have time complexity, which measures how long it takes to run an algorithm relative
to the quantity of the input. Forms of representation include:
1. Notation for Big-O (O)
2. In the alpha notation (), the
3. Notational theta ()
The second type of complexity is known as "space complexity," and it describes how much
memory the algorithm needs to run in its entirety. The input and the secondary memory are
both a part of this. Auxiliary memory refers to the amount of storage used by the method
beyond the size of the input data. When determining an algorithm's space complexity, it is
common practice to take auxiliary memory into account.
9.quick sort
An internal algorithm, quick sort uses a "divide and conquer" methodology to efficiently sort
data. Regarding this: Again and over, the array of items is subdivided until no further
subdivisions remain. The term "partition exchange sort" is another name for it. One of the
elements (the pivot) is used to divide the rest into subsets. Elements that are less than the pivot
are placed in the left partition, while those that are greater than the key are placed in the right
partition.
20
10.merge sort
Merge sort uses a divide-and-conquer method and is an external algorithm. Regarding this: The
elements are repeatedly partitioned into two sub-arrays (n/2) until there is only one left. More
space is required by merge sort in order to sort the auxiliary array. In merge sort, three arrays
are used: two internal ones for storing each half, and one external one for storing the merged,
sorted list created by merging the first two arrays. The final step is to combine all the smaller
arrays into one large array of size n elements.
21
11.sorting algorithm- analysis
by comparing elements in the input, sorting algorithms determine the order of elements in the
sorted output. Any comparison-based sorting algorithm will take at least O(nlogn) time to sort
an array of n elements, so this is something to keep in mind while trying to find a suitable
sorting algorithm.
The algorithms for sorting and how they compare to one another are listed below.
In a bubble sort, elements are compared to discover the greatest one in the unsorted portion,
and that one is moved into the sorted portion. To do a selection sort, elements are compared to
determine the least-common denominator, and that element is moved into the sorted portion.
Using a comparison of items, insertion sort can identify where an item should be placed in a
partially sorted array. The merge sort algorithm compares the items of two sorted arrays and
combines them into a single, final array. Fast sort: using element comparison to split the
unsorted array in half around a central pivot.
22
1. During the heapify procedure, Heapsort compares each element to determine which
ones are the smallest and moves them to the front of the array (if we are using the minheap).
2. The aforementioned methods for sorting can be broken down into two groups, one
with worst-case time complexity of O(n2) and the other with worst-case time
complexity of O(nlogn).
3. Sorting algorithms with complexity O(n2) include Bubble sort, Selection sort, and
Insertion sort.
4. Sorting algorithms of complexity O(nlogn) include the Merge sort, Quicksort, and
Heapsort. Keep in mind that Quicksort has a worst-case performance of O(n2) but still
manages to complete its tasks in a fairly respectable O(nlogn) time.
In these sorting algorithms, we execute a variety of activities, not just comparisons. The number
of such operations, however, will never exceed the number of comparison operations. Hence,
the temporal complexity of the aforementioned sorting algorithms is determined by the
comparison process.
12.quick sort vs merge sort
Quick sort
23
Merge sort
All of MergeSort's crucial operations occur after the recursive calls, demonstrating end order
or bottom-up recursion. This indicates that the array is subdivided into singletons (of size 1)
and that all processing occurs on the exit path from the recursive call.
QuickSort is the polar opposite of that. The primary partitioning operation is completed before
any recursive calls, making use of top-down recursion.
Analysis
Let T(n) be the worst-case number of array (of size n) comparisons and data moves, and we
see that for n > 1, T(n) is composed of these counts:
using A's halves as a recursive call T(n) = 2 * T(n/2) + O is the result when the two parts of A
are combined (stable): T(n) (n)
24
13. Finding shortest path using dijkstra model
Output: 0 4 12 19 21 11 9 8 14
Explanation: The distance from 0 to 1 = 4.
The minimum distance from 0 to 2 = 12. 0->1->2
The minimum distance from 0 to 3 = 19. 0->1->2->3
The minimum distance from 0 to 4 = 21. 0->7->6->5->4
The minimum distance from 0 to 5 = 11. 0->7->6->5
The minimum distance from 0 to 6 = 9. 0->7->6
The minimum distance from 0 to 7 = 8. 0->7
The minimum distance from 0 to 8 = 14. 0->1->2->8
14.Finding the shortest path using bellman ford model
The distance to the source is set to zero and the distance to each vertex is set to infinity. Produce
25
a |V|-by-|V| array dist[] with all values set to infinity except dist[src], where src is the source
vertex.
In this procedure, the quickest routes are determined. Take the next step |V|-1 times, where |V|
is the number of vertices in the graph. Do the following on each u-v edge:
Dist[v] should be changed to dist[v] = dist[u] + weight of edge uv if and only if dist[v] is greater
than dist[u] plus the weight of edge uv.
The presence or absence of a negative weight cycle in the graph is reported at this stage.
Repeatedly walk down each edge and perform the following steps for each edge u-v...... "Graph
has negative weight cycle" is true if and only if dist[v] > dist[u] + weight of edge uv. The
rationale behind step 3 is that if the graph does not have a negative weight cycle, then step 2
will guarantee the shortest distances. A negative weight cycle exists if, after going through all
the edges again, we find a shorter path to any vertex.
15.Find the newest to oldest registered participants using abstract data type
 The information is often kept in key order in a list with a head structure that includes
a counter, pointers, and the address of a comparison function used to compare the
information in the list.
 The data node stores the reference to a data structure and a pointer to the next node in
the list (which is itself a pointer).
 Below is a list of all the ADT functions:
26
 Use get() to retrieve the item in the list that corresponds to the specified index.
 insert() allows you to insert an item into the list at any index.
 remove() eliminates the first occurrence of each element in a non-empty list.
 To delete an item from a non-empty list at a certain index, use removeAt().
 Replace an element at any point with another using the replace() method.
 To find out how many items are in a list, use the size() method.
 Is the list empty? Return true with isEmpty(); otherwise, return false.
 The isFull() method returns true if the list is at capacity and false otherwise.
16. Stack abstract data
17. Operations in stack
Operations on a Stack
Different operations can be performed on a stack. The primary function of stack operations is
data extraction, which is why they are so commonly utilized.
In this section, we will look at a few examples of stack operations.
27
1. push() ()
When defining a stack, the push operation is used to append data to the head of the stack.
2. pop() ()
The stack specification includes a function called "Pop" that is used to remove items from the
stack's top.
3. topElement() / peek()
28
TopElement / Peek is a function in the stack which is used to extract the element present at the
stack top.
18.Review
SYSTEMATIC INQUIRY
STUDENT REGISTRATION SYSTEM PROJECT: CURRENT SYSTEM
To analyze a system is to investigate its inner workings and external connections in great detail.
The critical inquiry here is, What exactly are the issues with the current system? Is there
anything that can be done to fix it? When a user or management begins examining the software
within the context of the currently available system, analysis can begin.
Information gathered during analysis of the many documents, points of decision, and
transactions processed by the current system. Data Flow Diagram, interviews, and other
methods are frequently employed in the system. Information gathering for system development
is a skill that calls for training, experience, and common sense. How well the problem is
identified, researched, and carried out via the chosen solution is crucial to the system's success.
The framework for the problem's solution, as well as its methods of understanding, should be
provided by a good analysis model. This calls for a comprehensive study of the system through
the collection of relevant data. The suggested system must be scrutinized carefully in light of
the requirements.
Cost-benefit analysis and a feasibility study.
29
We need to preserve a number of student-related records in the present system and prefer to
enter student information and grades manually. Teachers and administrators at the school have
access to students' grades and personal information solely through this system. This takes a
long time and is expensive.
SYSTEM IDEA - STUDENT REGISTRATION SYSTEM PROJECT
The pupils would be able to enter their own information into our proposed system. As a result,
administrative and classroom costs have decreased for schools. In addition to its numerous
benefits, the system makes it simple to make changes to a student's profile or remove them
entirely. Students' grades are stored in a database where they can be accessed at any time.
STUDENT REGISTRATION SYSTEM PROJECT FEASIBILITY REPORT
It is prudent to consider the likelihood of success before committing to a solution. When a
system is created, it has an effect on the organization, and this effect can be studied via the lens
of feasibility. Impact may be beneficial or harmful. In order for a system to be viable, the
positives must nominate the negatives. There are two types of feasibility analyses that can be
conducted in this case: technical and economic.
Doable from a Technological Standpoint:
Since acquiring the resources needed for creating and sustaining the system won't provide much
of a challenge, we can confidently assert that it is technically possible. In this case, we are
making use of the previously existing resources in the organization, all of which are necessary
for the development of the program and its ongoing maintenance.
Possibility from an Economic Standpoint
As the necessary infrastructure was already in place, the company saved a lot of money on its
development. The only thing that needs to be done is to provide a conducive setting for growth
under careful guidance. Doing so will allow us to make the most efficient use of the available
resources. There will be no room for further investment in the business even when the
development is complete. As a result, the system can be implemented with reasonable costs.
30
Quantifying the Procedures
It is possible to evaluate an algorithm's performance by observing the number of operations
required to solve problems of varying input sizes.
As a baseline, let's evaluate the efficiency of the value-locating linear search algorithm. The
algorithm goes over the list item by item, testing each one against the predetermined standard.
If the value is located, the index is returned instantly. It checks each item in the list, and if it
still can't locate the value, it returns -1.
The
pseudocode
for
that
algorithm
is
as
follows:
Measuring an algorithm's efficiency
PROCEDURE searchList(numbers, targetNumber) { index ← 1 REPEAT UNTIL (index >
LENGTH(numbers)) { IF (numbers[index] = targetNumber) { RETURN index } index ←
index + 1 } RETURN -1 }
Abstracrt data type
The previous two decades of programming language study have been dominated by the
evolution of abstract data types and object-oriented programming, both of which have their
origins in Simula 67 but now take on many different forms. A primary goal of this course is to
compile and structure arguments that highlight key differences between the two approaches.
The arguments center on the different processes for data abstraction and use examples to
highlight the distinctions between them. Important aspects of either paradigm, including as
inheritance, overloading, and mutable state, are outside the scope of this discussion. In this
work, we compare the various uses and meanings of the terms "abstract data type" and "objectoriented programming" that have emerged over time, drawing from historical accounts and
popular usage.
In programming, abstract data types are commonly referred to as user-defined data types since
they allow for the definition of new types that mimic base data types. Like the fundamental
INTEGER type, which has the operations +, -, etc., specified on it, an abstract data type has a
type domain and a set of operations defined on that domain, but the representation of the type
31
domain is hidden from the clients. CLU [[31, 30]] is where abstract data types were initially
developed in their pristine form. Existential types provide the foundation for the notion of
abstract data types [33, 13]. They're also connected to algebraic specification [20, 23]. A
"conceived separate from concrete reality" [41] type is what is meant by "abstract type" in this
discussion. Object-oriented programming entails building objects that have a set of procedures
that have access to their own shared local state. More so than any well-known mathematical
topic, the similarities between objects and machines or other things in the real world are
striking. This guide uses Smalltalk as an example of an ideal OO language. It has been
suggested that objects are best understood in relation to closure [2, 37, 8], but different models
are viable [26]. When referring to the employment of collections of procedures to achieve a
data abstraction, the word "object" is not very evocative. Therefore, we choose the term
"procedural data abstraction" to describe the method of using procedures as abstract data.
Data Hiding
If data is tampered with, it can lead to false results and threaten data integrity, making it the
most fragile and important part of any software. The ability to hide information is useful in this
situation. In object-oriented programming (OOP), data hiding is an inborn mechanism that
conceals internal object features from the user. The purpose of data concealing is to shield
information belonging to a class from prying eyes. Data hiding in C++ protects sensitive
information from accidental or intentional modifications to the code by limiting access to only
the people who need it.
Hiding data from object members is what's known as "data hiding" in C++. If a member of an
object attempts to access private information, the program will throw an error. This safeguard
prohibits the developer from accessing information that has been hidden due to errors. Features
that exist internally but have no obvious benefit to the end user are often hidden. Abstraction
and encapsulation are two other OOP features closely related to data hiding in C++.
Data Abstraction
By the use of data abstraction, just the most essential parts of a program's interface are made
visible to the user, while the underlying complexity is hidden. Let's examine a real-world
instance to get a clearer picture. Check out what's on TV right now. The TV may be turned on
and off, the channel changed, the volume adjusted, and additional devices like VCRs, DVD
32
players, and speakers plugged in. Yet you don't know how the TV works on the inside.
How it takes in information, processes it, and displays the findings is a mystery to you. To
illustrate the difference between internal and external implementation, consider television. The
use of data abstraction safeguards class implementation against unintended errors and enables
it to evolve in response to new requirements or bug reports without requiring user participation.
Data Encapsulation
Encapsulation occurs when information and its associated operations are packaged together
into a single entity called a class. To put it plainly, if an object has a hidden attribute from the
outside and bundles it with methods that provide read or write access to it, then the object can
be used to conceal sensitive information and restrict access to its internal state.
Advantages of using implementation independent data structure
The data structures used in a software are a key factor in evaluating its efficiency. Let's pretend
we have a dataset and are interested in discovering the location of a specific record inside it.
So, if we keep our data in an array, we will have to check each element in turn during our
search. that an array might not be the best option in this case. Search times can be drastically
reduced by using more efficient data structures such hash tables, binary search trees, and
ordered arrays.
We can use a data structure that has already been implemented in any other scenario, making
them very reusable. Implementations of data structures can be distributed as libraries and used
in a variety of software. When the ADT defines the data structure, it provides an additional
level of abstraction. The client program does not need to understand the details of the
underlying data structure in order to communicate with it; instead, it need only understand the
interface.
Differentiating Between Forms of Data Structures
A data structure is said to be linear if and only if all of its parts can be sorted in a straight line.
Except for the very first and very last components, all other items in a linear data structure have
predecessors and successors.
33
An assortment of linear data structures includes arrays, linked lists, stacks, and queues. A nonlinear data structure has data that is not ordered sequentially but rather has each element
connected to two or more others in a non-linear fashion. The presentation of the data follows
no obvious structure.
19.Conclusion
The Students Management System for the SLIA was put in place to help manage the mundane
tasks that have previously been handled manually at BAE in a more systematic and efficient
manner. A web-based centralized system was presented as a means of making SLIA's
administrative processes more streamlined and effective for its student body. The project's
goals needed to be broken down into the following components for it to be successful.
System for managing and notifying students about payments and attendance; System for
managing and notifying students about examination records; System for managing and
notifying students about BAE course records; System for managing and notifying staff about
staff information and attendance; System for managing and notifying students about generating
reports.The requirements analysis phase correctly determined the exact client requirements and
the problem domain that expects to create the web based solution. The defined scope of the
project was then used to classify the discovered requirements as either functional or nonfunctional. Using the activities and phases laid out by the Rational Unified Process
methodology, the implementation tasks were carried out module by module after the solution
was designed. After that, we did a thorough job of system testing by creating a variety of test
cases to exercise the features of the finalized system. It is safe to say that the project's goals
have been met to a satisfactory degree and that the client has not raised any major issues
because of the user acceptance testing that was performed with a small sample of actual users.
However, due to the significance and complexity of SLIA's current activities in the sphere of
professional education, the client organization would prefer to run the new Student
Management System in parallel with their old manual system for a set amount of time. This
will facilitate a painless switch to the new system and allow for the early detection and
resolution of any operational issues that may arise as a result of the system's extended use.
34
20.Reference
Eriksson, U. 2017. Functional Requirements vs Non Functional Requirements. [Online].
ReQtest.
Available:
http://reqtest.com/requirements-blog/functional-vs35
non-functional-
requirements/ [Accessed: Aug 04, 2017].
Techterms.com. 2017. RUP (Rational Unified Process) Definition. [Online]. Available:
https://techterms.com/definition/rup [Accessed: Aug 05, 2017].
"Definition of 'Systems Design' - The Economic Times", The Economic Times, 2017.[Online].
Available: http://economictimes.indiatimes.com/definition/systems- design. [Accessed: Aug
05, 2017].
"What is Object-Oriented Analysis and Design (OOAD)? - Definition from Techopedia",
Techopedia.com,
2017.
[Online].
Available:
https://www.techopedia.com/definition/21104/object-oriented-analysis-and-design-
ooad.
[Accessed: Aug 11, 2017].
"Aqvatarius's
profile
on
CodeCanyon",
CodeCanyon,
2017.
[Online].
Available:
https://themeforest.net/user/aqvatarius. [Accessed: Oct 07, 2017].
"What is Software Testing? - Definition from Techopedia", Techopedia.com, 2017. [Online].
Available: https://www.techopedia.com/definition/17681/software- testing. [Accessed: Oct 07,
2017].
"Software Testing - Methods", www.tutorialspoint.com, 2017. [Online]. Available:
https://www.tutorialspoint.com/software_testing/software_testing_methods.htm.
[Accessed:
Oct 07, 2017].
John H. Daniels Faculty of Architecture, Landscape, and Design. [Online]. Available:
https://www2.daniels.utoronto.ca/prospective- students/programs/bachelor-arts-architecturalstudies [Accessed: Jul 01, 2017].
36
D. Thakur, "Requirements Analysis in Software Engineering", Ecomputernotes.com, 2017.
[Online]. Available: http://ecomputernotes.com/software-engineering/requirementsanalysis.
[Accessed: Jul 24, 2017].
"Open Source Student Information System - Fedena", Projectfedena.org, 2017. [Online].
Available: http://www.projectfedena.org/. [Accessed: Jul 29, 2017].
"Fedena - School Management Software", Fedena.com, 2017. [Online]. Available:
https://www.fedena.com/feature_tour. [Accessed: Jul 29, 2017].
N. Morpus, "The Top 6 Free and Open Source School Administration Software - Capterra
Blog", Blog.capterra.com, 2017. [Online]. Available: http://blog.capterra.com/the-top-6-freeschool-administration-software/. [Accessed: Jul 31, 2017].
"Free School Software & Online School Management System", Fekara, 2017. [Online].
Available: https://fekara.com/. [Accessed: Jul 31, 2017].
r. singh, "10 Best School Management Software or School ERP System", Technofizi.net, 2017.
[Online]. Available: https://technofizi.net/best-school- management-software-or-school-erpsystem/. [Accessed: Sep 30, 2017].
Techopedia.com. 2017. What is a Functional Requirement?
Techopedia.[Online].Available:
- Definition from
https://www.techopedia.com/definition/19508/functional-
requirement [Accessed: Aug 02, 2017].
"Software Testing Levels - Software Testing Fundamentals", Software Testing Fundamentals,
37
2017. [Online]. Available: http://softwaretestingfundamentals.com/software-testing-levels/.
[Accessed: Oct 07, 2017].
38
Download