Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

COL-A-056062 DSA COM73 FMSuhail

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

DSA

DATA STRUCTURE & ALGORITHMS

FM Suhail COL/A-056062 | DSA | 2018


ESOFT METRO CAMPUS
#3, De Fonseka Road, Colombo 04.

Higher National Diploma in Computing & Systems Development

Assignment Submission Form


Name F Mohamed Suhail Name of Group Members (If
ESOFT Reg. No COL/A-056062 Applicable)
Edexcel No K954364
Module Name DSA
Name of the Lecturer Mr. Siva Raam
Date Due 10th August 2018
Date Submitted 06th September 2018
Fine
Email-Address Kaayithfms1997@gmai.com
Contact No 0767617597
To be filled by ESOFT
Check List CD Assignment Formatting Sheet Harvard Referencing
() Brief
Signature on Signature on Student Declaration
Coversheet

Herewith I agree for the given terms and conditions on plagiarism & Academic dishonesty also
I declare the work submitted doesn’t breach these regulation.

Note: Keep the softcopy of the assignment with you until the official results released by ESOFT. ESOFT has all rights
to request the softcopy again at any time.

_______________________ ________________________

Signature Date
Assignment Brief

BTEC Level 4-5 HNC/HND Diploma (QCF)

To be filled by the Student


Name of the Student :

Edexcel No : Registration No: Batch No:

Unit Assessment Information

Qualification : Higher National Diploma in Computing and Systems Development

Unit Code & Title : Unit 34 - Data Structures and Algorithms

Assessment Title & No’s : Implementation of Algorithms - (DSA – 16 – 001)

Learning outcomes and grading opportunities:

LO 01: Understand data structures and algorithms


Learning LO1.1 LO1.2 LO1.3
Outcomes
LO 02: Be able to implement data structures
Learning LO2.1 LO2.2 LO2.3
Outcomes
LO 03: Understand how strings are structured and processed
Learning LO3.1 LO3.2
Outcomes

Date Issued : Date Due :

Merit and Distinction Descriptor


Date of Submission:
M1 M2 M3 D1 D2 D3

Assessor : Date Assessed:

Internal Verifier (IV): Date of IV:


Statement of Originality and Student Declaration

I hereby, declare that I know what plagiarism entails, namely to use another’s work and to
present it as my own without attributing the sources in the correct way. I further understand
what it means to copy another’s work.

1. I know that plagiarism is a punishable offence because it constitutes theft.


2. I understand the plagiarism and copying policy of the Edexcel UK.
3. I know what the consequences will be if I plagiaries or copy another’s work in any of
the assignments for this program.
4. I declare therefore that all work presented by me for every aspect of my program, will
be my own, and where I have made use of another’s work, I will attribute the source
in the correct way.
5. I acknowledge that the attachment of this document signed or not, constitutes a
binding agreement between myself and Edexcel UK.
6. I understand that my assignment will not be considered as submitted if this document
is not attached to the attached.

Student’s Signature: …………………………… Date:


……………
Task 1

A palindrome is a phrase that reads the same forwards as it does backwards. For example,
“DAD”,” MOM”,” madam” are examples for palindrome.

1.1.Write a program that figures out whether the given string is a palindrome. Use
suitable String operations to avoid white spaces and punctuation (LO3.2) (D3.4)

For example:

"Never a foot too far, even." is a palindrome.

"Top step -- Sara's pet spot." is a palindrome.

1.2.Create an Example Stack class for this problem. Use Array List or an array to
implement the Stack, use suitable stack operations. (LO 2.1)
1.3.Identify and implement opportunities for error handling and reporting. (LO 2.2)
1.4.Prepare a user manual for the developed solution to assist the users to work with it.
(M 3.1)

Task 2

‘Read-With-Us’ Library Systems provides book reservation facilities to their members. The
reservation system uses a waiting list or book or other reading material allocation. According
to the library rules and regulations, when possible match between reservation and the book is
found the member is contacted via email or SMS and informed. If member is not responding
within the given time period, she or she is places back of the waiting list and must wait again.

We will simulate this process using a queue, and simplify the rules. We will ignore the realistic
constraints of the members, and simply have each member store a reference number for the
book (a random number). We will also assume that each book, once accepted, will be occupied
from a member ID.

Insert book details through the keyboard. Each book should have Reference number (a random
number ex: 2552)

The book Assignment process should remove a member from the queue if the member
“accepts” the reservation. If the member accepts then delete the member node. If the member
rejects the reservation delete the member, insert him to the back of the queue and compare next
member and repeat. This process repeats until all members find their book
2.1.Write your own implementation of the queue by using a linked list for this problem
with all the queue operations. (LO 1.1)
2.2.Test the above application with a suitable test cases (LO 2.3)

Task 3

3.1 Implement Linear/Binary search using recursive algorithm and non-recursive


algorithm, and compare the performance. (LO 1.3)
3.2.Sort the array given below with two different algorithms and compare the
performance. {12, 35, 30, 85, 69, 102, 99}
(LO 1.2)
3.3.Explain common string operations such as concatenation, substring, etc., also state
their practical applications by giving suitable examples. (LO 3.1) (M1.3)
Practical Observation Sheet

Module: Data Structures and Algorithms

Unit No: 34

Student Name: _________________________________

Activity Activity Learning Date Signature


No Outcome
(LO)
1 Provide evidence of coding, and LO 2.1
explain a piece of coding to the LO 3.2
audience.
2 Run the solution LO 2.1
LO 3.2
3 Test the solution with random data LO 2.3
4 Prove the use of Error Controlling LO 2.2
Mechanism in the solution and Error
reporting structure
5 Compare the performance of different D2
algorithms

Comments:

Assessor Name :

Date :

Signature :
Assessment Criteria
Possible
Outcomes/Criteria for PASS Page Feedback
evidence
LO1 Understand data structures and algorithms
1.1 produce design Task 2.1
specification for data
structures
explaining the valid
operations that can be carried
out on the structures
1.2 explain the operation and Task 3.2
performance of sorting and
search algorithms
1.3 explain the operation of Task 3.1
recursive algorithms and
identify situations when
recursion is used

LO2 Be able to implement data structures and algorithms


2.1 implement data structures Task
in an executable
1.2
programming language in the
context of well-defined
problems
2.2 implement opportunities Task
for error handling and
1.3
Reporting

2.3 test results to enable Task


comparison with expected
results 2.2
LO3 Understand how strings are structured and processed
3.1 explain common string Task
operations and their practical 3.3
applications
3.2 demonstrate the outcome Task
of string operations in 1.1
specified algorithms.

Grade Descriptor for MERIT Possible evidence Feedback


M1 Identify and apply strategies Compare different
to find appropriate solutions
algorithms

M1.3 An effective approach to study Search about different


and research has been string operations
Applied
Task 3.3

M2 Select / design appropriate Proper use of Harvard


methods / techniques
Referencing

M2.3 A range of sources of Search about different


string operations
information has been used

M3 Present and communicate Documentation is


appropriate findings
well structured
M3.1 The appropriate structure and adhering to the
approach has been used formatting guidelines
with non-overlapping
facts
Data provided about
the company are
accurate, reliable and
consistent related to
Task 1.4
Grade Descriptor for DISTINCTION Possible evidence Feedback
D1 Use critical reflection to Report: shown in the
evaluate own work and self-reflection
justify valid conclusions section, good
conclusion with
D1.1 conclusions have been arrived at suggestions for
through synthesis of ideas and have further improvement
been justified

D2 Take responsibility for Undertaken Activities


managing and organizing from 01 – 05 as
activities mentioned in the
observation sheet
D2.3 Activities have been managed Submit the work on
time
D3 Demonstrate convergent /
lateral / creative thinking Task 1.1, Task 2.1,
Task 3.1, Task 3.2
D3.4 problems have been solved.

Strengths: Weaknesses:

Future Improvements & Assessor Comment:

Assessor: Signature:
Date: ____/____/______
Internal Verifier’s Comments:

Internal Verifier: Signature:


Date: ____/____/______
Acknowledgement

Initially, I would like to thank my parents for their valuable contributions for their morally,
financially towards the completion of this project. I am also grateful to appreciate my lecturer
at ESOFT Computer Studies (Pvt.) Ltd, Colombo, Mr. Siva raam who was guiding me with
his kindness and patience throughout the assignment, without his help and kind guidance this
project would not have been completed.

I would take this opportunity to thank my Program Coordinator Miss. Oshandhi


Karunaarachchi who gave me this wonderful opportunity to do the assignment, who was
guiding me very patiently since I started the assignment on Data Structure and Algorithms.

Thank you!

-FM Suhail-

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 23


Table of Contents
Acknowledgement ..................................................................................................................... 0

1. Palindrome in java ............................................................................................................. 4

1.1 Codes for Palindrome checker ......................................................................................... 4

1.2 Palindrome code by using stack with array list ........................................................... 6

1.3 Error handling by using Net beans .............................................................................. 7

1.4 User manual for the developed solution...................................................................... 8

2. Queue with linkedlist ......................................................................................................... 9

2.1 Queue code by using linkedlist ........................................................................................ 9

2.2 Test case for the software .......................................................................................... 13

3. Searching and sorting algorithms..................................................................................... 14

3.1 Implement Linear/Binary search using recursive algorithm and non-recursive algorithm,
and compare the performance. ............................................................................................. 14

3.1.1 Linear Search .......................................................................................................... 14

3.1.2 Binary Search .......................................................................................................... 15

3.1.3 Comparison Chart ................................................................................................... 16

3.2 Sort the array given below with two different algorithms and compare the performance.
{12, 35, 30, 85, 69, 102, 99} ................................................................................................ 18

3.2.1 Merge sort ............................................................................................................... 18

3.2.2 Insertion sort ........................................................................................................... 19

3.2.3 Difference between Merge and Insertion ................................................................ 20

3.3 Explanation of the common string such as concatenation, substring ............................ 21

3.3.1 Sub-Strings .............................................................................................................. 21

3.3.2 Concatenation .......................................................................................................... 22

3.3.3 Trim Method ........................................................................................................... 23

Gantt chart .................................................................................................................................. 0

Conclusion ................................................................................................................................. 0

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Self-Criticism ............................................................................................................................. 1

Appendix .................................................................................................................................... 2

References .................................................................................................................................. 2

Figure 1 : Palindrome Code by CharAt() ................................................................................... 4

Figure 2 : Palindrome code by Stringbuilder ............................................................................. 4

Figure 3 : Palindrome code by substring ................................................................................... 5

Figure 4 : DAD .......................................................................................................................... 5

Figure 5 : DADY ....................................................................................................................... 5

Figure 6 : Palindrome code by using stack ................................................................................ 6

Figure 7 : MADAM ................................................................................................................... 6

Figure 8 : MADAMM ................................................................................................................ 6

Figure 9 : Stack error ................................................................................................................. 7

Figure 10 : Stack error handle .................................................................................................... 7

Figure 11 : Array list error ......................................................................................................... 8

Figure 12 : Array list error handle ............................................................................................. 8

Figure 13 : Get number .............................................................................................................. 8

Figure 14 : Check number.......................................................................................................... 9

Figure 15 : Linked list node ....................................................................................................... 9

Figure 16 : Linked list code 1 .................................................................................................. 10

Figure 17 : Linked list code 2 .................................................................................................. 11

Figure 18 : Linked list use ....................................................................................................... 11

Figure 19 : Linked list set ........................................................................................................ 12

Figure 20 : Linked list use ....................................................................................................... 12

Figure 21 : Average chart of sort algorithms ........................................................................... 20

Figure 22 : Sub-String .............................................................................................................. 21

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Figure 23 : Concatenation ........................................................................................................ 22

Figure 24 : Trim ....................................................................................................................... 23

Table 1 : Test Case ................................................................................................................... 13

Table 2 : Difference between Linear and Binary ..................................................................... 16

Table 3 : Self criticism ............................................................................................................... 1

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


1. Palindrome in java

Palindrome in Java: Java program to check if a string is a palindrome or not. A string is a


palindrome if it remains unchanged when reversed, for example, "dad" is a palindrome as
reverse of "dad" is "dad" whereas "program" isn't a palindrome as its reverse is “margorp”.
Some other examples of palindrome strings are "mom", "madam", "abcba", “12321”, "c++ &
++c”.

1.1 Codes for Palindrome checker

By using charAt() :

Figure 1 : Palindrome Code by CharAt()

By using StringBuilder

Figure 2 : Palindrome code by Stringbuilder

By using substring

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Figure 3 : Palindrome code by substring

Result check by using “DAD”

Figure 4 : DAD

Result check by using “DADY”

Figure 5 : DADY

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


1.2 Palindrome code by using stack with array list

Figure 6 : Palindrome code by using stack

Result check by using “MADAM”

Figure 7 : MADAM

Result check by using “MADAMM”

Figure 8 : MADAMM

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


1.3 Error handling by using Net beans

Stack error

Figure 9 : Stack error

Handle stack error

Figure 10 : Stack error handle

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Array list error

Figure 11 : Array list error

Handle array list error

Figure 12 : Array list error handle

1.4 User manual for the developed solution

1. Get the number to check whether its palindrome or not


2. Reverse the number
3. Compare the original number with reversed number
4. If both same print palindrome or not.

Figure 13 : Get number

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Figure 14 : Check number

2. Queue with linkedlist

2.1 Queue code by using linkedlist

Figure 15 : Linked list node

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Figure 16 : Linked list code 1

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Figure 17 : Linked list code 2

Use of Linked List:

Figure 18 : Linked list use

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Figure 20 : Linked list use

Figure 19 : Linked list set

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


2.2 Test case for the software

Table 1 : Test Case

Test Expect Result


Actual result
Case info result status

Please
Insert enter A
wrong or B
Success
input for otherwise
1st search it’s not
work

Getting
reference
number
Book
and Success
order
success
message
of order

Sorry,
Wrong the book
Success
book ask is not in
stock

Please
check
Wrong ID
your Success
input
member
ID

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Please
check
Wrong
your Success
ref Input
reference
number

Enter A
for
Accepting
accepting Success
order
R for
rejecting

3. Searching and sorting algorithms

3.1 Implement Linear/Binary search using recursive algorithm and non-recursive


algorithm, and compare the performance.

3.1.1 Linear Search

Linear search is a way for finding a goal fee inside a listing. It sequentially exams every element
of the list for the target value until an in shape is determined or until all of the elements had
been searched. Linear search runs in at worst linear time and makes at maximum n
comparisons, in which n is the length of the list. If every detail is equally likely to be searched,
then linear seek has a median case of n/2 comparisons, but the common case may be affected
if the search chances for every element range. Linear search is hardly ever practical because

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


other search algorithms and schemes, which includes the binary search algorithm and hash
tables, permit notably faster looking for all however brief lists.

Linear search is generally quite simple to enforce, and is realistic whilst the listing has only
some factors, or when performing a single search in an unordered list. Whilst many values
ought to be searched in the same list, it often will pay to pre-procedure the listing so as to use
a faster technique. As an example, one can also sort the list and use binary search, or build an
efficient search data structure from it need to the content of the list change often, repeated re-
organisation may be more trouble than it's far well worth.

As an end result, despite the fact that in principle other search algorithms can be quicker than
linear search (as an instance binary search), in practice even on medium-sized arrays (round
100 items or much less) it is probably infeasible to apply something else. On larger arrays, it
only makes experience to apply different, quicker search techniques if the data is huge
sufficient, because the preliminary time to prepare (sort) the facts is corresponding to many
linear searches

3.1.2 Binary Search

Binary search is a search algorithm that finds the placement of a target value inside a sorted
array. Binary search compares the target value to the middle element of the array. If they're no
longer equal, the 1/2 wherein the target cannot lie is eliminated and the search continues at the
closing 1/2, once more taking the middle element to compare to the target value, and repeating
this till the target value is determined. If the search ends with the remaining 1/2 being empty,
the target isn't always in the array. Despite the fact that the idea is easy, implementing binary
search effectively requires attention to a few subtleties about its exit conditions and midpoint
calculation.

Binary search runs in logarithmic time within the worst case, making O (log n) comparisons,
in which n is the number of elements within the array, the O is large O notation, and log is the
logarithm. Binary search takes consistent (O(1)) space, which means that the distance taken by
the algorithm is the same for any range of factors within the array.[6] Binary search is quicker
than linear search except for small arrays, but the array need to be sorted first. Even though

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


specialized data structures designed for instant searching, consisting of hash tables, may be
searched more efficaciously, binary search applies to a much broader range of problems.

Binary search works on sorted arrays. Binary search starts off evolved with the aid of evaluating
the middle element of the array with the target value. If the target price matches the middle
element, its position in the array is again. If the target value is less than the middle detail, the
search keeps inside the lower 1/2 of the array. If the target value is greater than the middle
element, the search keeps inside the top 1/2 of the array by way of doing this, the algorithm
eliminates the 1/2 wherein the goal cost cannot lie in each generation.

3.1.3 Comparison Chart

Table 2 : Difference between Linear and Binary

BASIS FOR
LINEAR SEARCH BINARY SEARCH
COMPARISON

Time Complexity O(N) O(log 2 N)

Best case time First Element O(1) Centre Element O(1)

Prerequisite for an Array must be in sorted


No required
array order

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


BASIS FOR
LINEAR SEARCH BINARY SEARCH
COMPARISON

Worst case for N N comparisons are Can conclude after only

number of elements required log2N comparisons

Can be implemented Cannot be directly


Array and Linked list
on implemented on linked list

Require processing to insert


Easily inserted at the
Insert operation at its proper place to
end of list
maintain a sorted list.

Divide and conquer in


Algorithm type Iterative in nature
nature

Easy to use and no Anyhow tricky algorithm

Usefulness need for any ordered and elements should be

elements. organized in order.

Lines of Code Less More

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


3.2 Sort the array given below with two different algorithms and compare the performance.
{12, 35, 30, 85, 69, 102, 99}
3.2.1 Merge sort

Merge sort is a recursive partitioning sort that divides, sorts and reassembles an array
into n/2 parts, and does a comparison on two items, sorts them and returns the result up the
recursion tree. It cannot skip over any already-sorted sections. It has good timing characteristics

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


on large data sets. The algorithm being recursive takes up more memory and overhead than
non-recursive sorts, but this can be mitigated in a pass-by reference implementation. Because
merge sort makes multiple partitions (n/2) it can lend itself to parallelism easier than some
other methods. This makes sense on multicore machines.

3.2.2 Insertion sort

Insertion Sort is an in-place sort that places items in their proper order one by one and
can skip over already-sorted areas. It needs n-1 passes and up to n*(n-1) comparisons to find
the right spot, but the average is (n/2) + 1 comparisons per item. Each pass gets faster as the
array gets more in sorted order, as less rearrangement needs to be done. The algorithm is simple
to implement and usually consists of two loops; an outer loop to pick items and an inner loop
to iterate through the array. This leads to a worse case of n2n2 time which is bad for huge data
sets, but on the other hand the code is simple and can run very fast on modern CPUs with cache.
Insertion sort is not as easily paralleled because each item has to be compared with potentially

all the other items. Small data sets can be sorted entirely in-cache, however.

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


3.2.3 Difference between Merge and Insertion

The difference between O (n^2) average and O (NLogN) constant. However Merge
Sort is not adaptive like Insertion Sort, meaning for nearly sorted lists, Insertion Sort beats
Merge Sort. Insertion Sort is also an in-place algorithm and ideal for low memory and nearly
sorted. Insertion Sort is good enough to be used in its binary modification for Tim Sort. So
each has its advantages and disadvantages. For large unordered, go with Merge Sort. For
smaller arrays or ranges, Insertion Sort is fine.

Some quite impressive optimizations have been achieved by beginning a sort with
merge sort and when each partition reaches a small enough threshold, switching to insertions
sort because it is fast on small data sets and beats merge sort once the array is nearly sorted.

Figure 21 : Average chart of sort algorithms

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


3.3 Explanation of the common string such as concatenation, substring
3.3.1 Sub-Strings

A sub-string is a sequence of characters that contains in a string value. Substrings helps in


separating a character or a set of characters apart from an existing string value thereby enabling
to make a modified copy of the original text. The methods such as Index Of, Index of Any,
Last Index Of, and Last Index Of any relies on substring techniques (Deitel &Deitel 2005).
The following points shows how sub-strings could be achieved using the Substring method and
its practical applications.

The Substring method takes 2 arguments in integer format to identify where it should
start the separation and where it should end. The Substring method does not accept the string
itself as an argument, therefore the string object is required to perform the operation rather than
the string text. The first 3 lines of code in figure 27 demonstrates the use of the Substring
method in C# language. One practical application of this method is that certain phrases from a
user’s input could be extracted to form a more relative output based on the input.

Figure 22 : Sub-String

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


3.3.2 Concatenation

Concatenation is the process of merging two data literals into a single literal. Concatenation
is not limited to string literals and could be used in any other data type such as binary, integer,
and floating point characters and Boolean. However, concatenation find its syntax to be
different across languages (Techopedia 2016). The application of concatenation for string
literals in the Java programming language is discussed below. Even in the Java programming
language itself, there are various approaches for concatenation of string values. Each approach
has their effects on performance and efficiency of the code. The easiest way to achieve
concatenation of strings in java is to simply merge 2 strings using the operator ‘+’ as shown
in the image below.

Figure 23 : Concatenation

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


3.3.3 Trim Method

The string trim method in java language is used to eliminate leading and trailing white
spaces from a string. It uses the Unicode value of space which is ‘\u0020’ to check whether
a given String contains such a Unicode at the beginning or the end, so this method cannot
omit middle spaces in the string (Java T Point 2014). A possible use of this method includes
validating user inputs where the user might have accidentally typed in white spaces at
the beginning or the end of the input. In such a case, the absence of omission of middle
spaces in the trim method comes as an advantage, because the input from the user is not
altered while validating. The image below shows how this method is being used in the
java language.

Figure 24 : Trim

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Gantt chart

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 23


Conclusion

In the beginning of this document at Task 1, a program for figuring out whether certain
strings are palindromes is developed. It uses many techniques and methods for
string processing to process the input strings to validate them, for instance removal of white
spaces and punctuation marks from the input string is practiced. This program uses an array
based stack to reverse the string to check whether the reversed output matches the processed
input. This method could be improved in the future where the array based stack could be
replaced with a linked list. However, a program that uses a linked list is developed for the
task 2 based scenario where the program enables processing of students in a waiting list in
the form of a queue using queue operations such as set-queue and unset-queue. As this is
already a better implementation, this program only requires a better design such as a Graphical
User Interface which would be more visually appealing than the current version which aides
an Output Console from the IDE. It is clear from the many types of algorithms presented and
explained through Task 3, that every algorithm is unique and is more efficient than others on
certain tasks, scenarios or conditions. For example, even though insertion sorting algorithms
are less efficient than merge sorting algorithms, for data sets below 10 – 12 elements in size,
insertion sorting out performs most of other types of algorithms available including merge sort.
However, itis worth noting that on average, for most cases, the Divide and Conquer algorithms
are more efficient and faster than Simple Sorting algorithms as they prove a more
logarithmic performance. Therefore, the use of the correct type of data structure as well as the
algorithm for the specific problem is always essential for implementing faster and efficient
programs.

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 23


Self-Criticism

Though it took so long to catch up, Data Structures & Algorithms became an interesting area
which helps in understanding how certain software work and behave. The different types
of data structures, algorithms and multiple approaches for sorting and searching data found on
this module reveals that the area studied is just the surface, and promotes the learning of much
more sophisticated methods in the future. As a novice, it is always hard to understand how
exactly modern software are supported using the techniques introduced in this module,
however while completing this assignment, it became evident that there are vast amounts of
research and experimental work dedicated for this area alone in which cases, the most
efficient approaches, algorithms and methods are found and invented, specially based on
their performance. However, it is a reason to worry, that such great research could not be
referenced in this document. It is a pleasure to learn about strings and how they could be
processed using different methods in a programming language. It is also a pleasure learning
about algorithms and where exactly specific algorithms should be used. However, it was
unclear and hard to understand about certain data structures such as Graphs and Trees, and how
the algorithms are used to sort data in such forms. While it was confusing how certain coding
practices and techniques differ the performance of algorithms, such as in the case of recursive
and non-recursive binary searching algorithms where the recursive always outperforms the
iterative one, they were always promising a whole new perspective of observing the problem
from which knowledge about how they actually work could be increased. These skills whether
great or small would be beneficent in the future whether it would be for sorting data or for
solving other problems as well. Therefore, this document would serve as a problem solver in
the future as it could be used as a revision tool when the above mentioned weaknesses arrive.

Table 3 : Self criticism

Strengths Weaknesses
Confidence in completing the assignment Difficulties in when explaining to others
before the deadline

Interest throughout the module and The time spent on a single task was quite
developing the system long

A big support from my family members Difficulties in arranging the tasks from
within the given time single documents

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Was able to understand how to develop a
system using NetBeans

All the required information gathered easily

Self-satisfied with my time management

Finally, I used to find useful articles, books


and websites which I gained very useful
information

Appendix

COL-A-056062_DSA
_COM73.rar

References

Abualrob, M. (2010) Iterative Binary search. Weblog. [Online] Available from:


http://www.8bitavenue.com/2010/09/iterative-binary-search/ [Accessed 06th August 2018.
GMT 11:25:27].

Beniwal, M., Singh, A., Diwan, A., Kaushik, J., Kumar, K.N., Singh, V., Gautam, N. & Joshi,
V.P. (2016) Insertion sorting.[Online] Available from: http://www.studytonight.com/data-
structures/insertion-sorting [Accessed 06th August 2018].

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


JAVA Programming. (2011) Linear Search, Binary Search and other searching Techniques.
[Online] Available from:
http://www.cprogramming.com/discussionarticles/sorting_and_searching.html [Accessed
15th August 2018].

Cormen, T.H., Leiserson, C.E., Rivest, R.L. & Stein, C. (2009) Introduction to Algorithms,
Third Edition. 3rd edition. [e-book] Massachusetts, MIT Press. Available from:
https://mitpress.mit.edu/books/introduction-algorithms [Accessed 15th August 2018].

Damier, I. (2015) Iterative Binary Search. [Online] Available from:


http://www.geekviewpoint.com/java/search/binary_search_iterative [Accessed 15th August
2018].

Deitel, H.M. & Deitel, P. (2005) Strings, Characters and Regular Expressions. In:JAVA for
Programmers. USA, Prentice Hall Professional, p. 616. Forrest, P. (2016)What is non-recursive
binary search Algorithm? Weblog. [Online] Available from:
http://www.answers.com/Q/What_is_non_recursive_binary_search_algorithm [Accessed 15th
August 2018. GMT 10:23:26].

Geeks for Geeks. (2016) Merge Sort . [Online] Available from:


http://quiz.geeksforgeeks.org/merge-sort/ [Accessed 20th August 2018].

Java T Point. (2014) Java String trim. [Online] Available from:


http://www.javatpoint.com/java-string-trim [Accessed 20th August 2018].

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Knight, V. (2013)Comparing Recursive and Iterative Algorithms: Binary Search and Factorial.
Weblog. [Online] Available from: http://drvinceknight.blogspot.com/2013/06/im-in-middle-
of-putting-together-new.html [Accessed 01st September 2018].

Rouse, M. (2007) Error Handling. Weblog [Online] Available from:


http://searchsoftwarequality.techtarget.com/definition/error-handling [Accessed 01st
September 2018. GMT 10:14:17].

Ruehr, F. (1998) Data Structures and Algorithms: Sorting Algorithms. Presented at Willamette
University. Oregon. [Online] Available from:
http://www.willamette.edu/~fruehr/dsa/lectures/sorting1.html [Accessed 01st September
2018].

Sorting Algorithms. [Online] Available from:


http://www.ee.ryerson.ca/~courses/coe428/sorting/insertionsort.html [Accessed 01st
September 2018].

Stoimen. (2011) Computer Algorithms: Binary Search. Weblog. [Online] Available from:
http://www.stoimen.com/blog/2011/12/26/computer-algorithms-binary-search/ [Accessed
01st September 2018. GMT 11:38:26].

Swartz, F. (2003)Java Notes: Algorithms: Recursive Binary Search. [Online] Available from:
http://www.fredosaurus.com/notes-cpp/algorithms/searching/rbinarysearch.html [Accessed
02nd September 2018].

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24


Techopedia. (2016)Concatenation. [Online] Available from:
https://www.techopedia.com/definition/3470/concatenation-programming [Accessed 02nd
September 2018].

Toptal. (2016) Merge Sort. [Online] Available from:


https://www.toptal.com/developers/sorting-algorithms/merge-sort [Accessed 02nd September
2018].

Tripathi, P. (2014) Binary Search Implementation using JAVA . Weblog. [Online] Available
from: http://www.c-sharpcorner.com/blogs/binary-search-implementation-using-c-sharp1
[Accessed 02nd September 2018. GMT 08:22:23].

Tutorials Point. (2016) Java – String concat() Method. [Online] Available from:
http://www.tutorialspoint.com/java/java_string_concat.htm [Accessed 05th September 2018].

FM SUHAIL COL/A-056062 | DSA | 2018 PAGE 24

You might also like