Chapter 1: Product Description

advertisement
Foreword
Welcome to the Android Smart Algorithm User Manual. Thank you for using
Android Smart Algorithm. This software aims to help you grasp algorithm and
data structure. It will present algorithm procedure with visual animation which
is helpful to understand how an algorithm works.
It is strongly recommended to read this document before you do any
operations. This manual contains detailed information of this software. It will
help guide you how to apply it.
This manual is divided into seven main sections: Introduction, Installation
handbook, Software component, Software function, Uninstall guide, glossary
and an appendix about more information.
Finally thank you again for selecting our product and hope it is helpful to your
study.
CSCI321 Project Group
19/09/2012
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Chapter 1: Product Description
1.1 About Smart Algorithm
The Smart Algorithm present algorithm with animation which includes bubble
sort, quick sort, insertion sort, heap sort, selection sort, tree, KMP string search,
Boyer Moore string search, Dijkstra's shortest path, Kruskal algorithm, Prim
algorithm, eight queens puzzle and Hanoi tower.
If you have any feedback, Please connect us by using Email or login on our
website.
Email address: @gmail.com
Website:
1.2 Product composition and main content list
1.2.1 Product composition
Please check the components of the product after you get algorithm space
system (ASS) though legal channels.
a. Zip file: It contains a Read me file, and JAR file for installation.
b. User manual: It is handbook which introduces this software. In addition, it
will guide you to setup and use this product.
1.2.2 CD content list
The main file in CD is list below
Directory Order File name Specification
/windows 1 Readme.txt Installation manual
2 Algorithm.jar Program file
/unix 1 README Installation manual
2 Algorithm.jar Setup program
Table 1 – File list in CD
1.3 Product features
Provide a friendly Interface
Support various operator system such as Solaris, AIX, Linux and
windows
Provide various algorithm animations such as sorting, backtracking,
divide and conquer etc.
1.4 Application Requirement
1.4.1 Software requirement
Windows
Microsoft Windows 2000, XP, Vista or 7 operating system
Sun Java 1.5 Runtime Environment
Unix
Solaris, AIX, linux operating system
Sun Java 1.5 Runtime Environment
1.4.2 Hardware requirement

A smart phone which run android system
Chapter 2: Installation
Requirements
Android 2.1 or later
How to get the Android Smart Algorithm?
To extend the user experience of Android Smart Algorithm, the Android
Smart Algorithm App is totally free to install.
1. Connect to your Smartphone or tablet computer (Android 2.2 and
above) to the internet using 3G or WIFI. For details on connection
setup, please check with your respective service provider
2. Simply go to www. .com clicks on the link or Please input “Smart
Algorithm” into search bar of Android Market Place to locate the Smart
Algorithm. Otherwise, you can scan the QR code as shown in bellow to
directly access to Smart Remote App in android market place.
QR code
3. After installation completed, please run the Smart Algorithm App to
initial the application.
How to start the Smart Algorithm?
Once you've installed Smart Algorithm, you'll see a ' Smart Algorithm ' icon
appeared in Android main screen.
When you open the Smart Algorithm, the main menu is shown as below.
When you click the setting button, the setting menu will be displayed as below.
Figure x
When you click the algorithm button, the algorithm list menu will be show in
Figure x.
Figure x
Appendix
Sorting algorithm
In computer science, a sorting algorithm is an algorithm that puts elements
of a list in a certain order. The most-used orders are numerical order and
lexicographical order. Efficient sorting is important for optimizing the use of
other algorithms (such as search and merge algorithms) that require
sorted lists to work correctly; it is also often useful for canonicalizing data
and for producing human-readable output.
Quick sort
Quick sort is a divide and conquer algorithm which relies on
a partition operation: to partition an array an element called a pivot is
selected. All elements smaller than the pivots are moved before it and all
greater elements are moved after it. This can be done efficiently in linear
time and in-place. The lesser and greater sub lists are then recursively
sorted. Efficient implementations of quick sort (with in-place partitioning)
are typically unstable sorts and somewhat complex, but are among the
fastest sorting algorithms in practice. Together with its modest O (log n)
space usage, quick sort is one of the most popular sorting algorithms and
is available in many standard programming libraries. The most complex
issue in quick sort is choosing a good pivot element; consistently poor
choices of pivots can result in drastically slower O(n²) performance, if at
each step the median is chosen as the pivot then the algorithm works in
O(n log n). Finding the median however, is an O (n) operation on unsorted
lists and therefore exacts its own penalty with sorting.
Bubble sort
Bubble sort is a simple sorting algorithm. The algorithm starts at the
beginning of the data set. It compares the first two elements, and if the first
is greater than the second, it swaps them. It continues doing this for each
pair of adjacent elements to the end of the data set. It then starts again
with the first two elements, repeating until no swaps have occurred on the
last pass. This algorithm's average and worst case performance is O (n2),
so it is rarely used to sort large, unordered, data sets. Bubble sort can be
used to sort a small number of items (where its asymptotic inefficiency is
not a high penalty). Bubble sort can also be used efficiently on a list of any
length that is nearly sorted (that is, the elements are not significantly out of
place). For example, if any number of elements is out of place by only one
position (e.g. 0123546789 and 1032547698), bubble sort's exchange will
get them in order on the first pass, the second pass will find all elements in
order, so the sort will take only 2n time.
Selection sort
Selection sort is an in-place comparison sort. It has O(n2) complexity,
making it inefficient on large lists, and generally performs worse than the
similar insertion sort. Selection sort is noted for its simplicity, and also has
performance advantages over more complicated algorithms in certain
situations. The algorithm finds the minimum value, swaps it with the value
in the first position, and repeats these steps for the remainder of the list. It
does no more than n swaps, and thus is useful where swapping is very
expensive.
Insertion sort
Insertion sort is a simple sorting algorithm that is relatively efficient for
small lists and mostly sorted lists, and often is used as part of more
sophisticated algorithms. It works by taking elements from the list one by
one and inserting them in their correct position into a new sorted list. In
arrays, the new list and the remaining elements can share the array's
space, but insertion is expensive, requiring shifting all following elements
over by one. Shell sort (see below) is a variant of insertion sort that is more
efficient for larger lists.
Shell sort
Shell sort was invented by Donald Shell in 1959. It improves upon bubble
sort and insertion sort by moving out of order elements more than one
position at a time. One implementation can be described as arranging the
data sequence in a two-dimensional array and then sorting the columns of
the array using insertion sort.
Heap sort
Heap sort is a much more efficient version of selection sort. It also works
by determining the largest (or smallest) element of the list, placing that at
the end (or beginning) of the list, then continuing with the rest of the list,
but accomplishes this task efficiently by using a data structure called
a heap, a special type of binary tree. Once the data list has been made
into a heap, the root node is guaranteed to be the largest (or smallest)
element. When it is removed and placed at the end of the list, the heap is
rearranged so the largest element remaining moves to the root. Using the
heap, finding the next largest element takes O(log n) time, instead
of O(n) for a linear scan as in simple selection sort. This allows Heapsort to
run in O(n log n) time, and this is also the worst case complexity.
Merge sort
Merge sort takes advantage of the ease of merging already sorted lists into
a new sorted list. It starts by comparing every two elements (i.e., 1 with 2,
then 3 with 4...) and swapping them if the first should come after the
second. It then merges each of the resulting lists of two into lists of four,
then merges those lists of four, and so on; until at last two lists are merged
into the final sorted list. Of the algorithms described here, this is the first
that scales well to very large lists, because its worst-case running time is O
(n log n). Merge sort has seen a relatively recent surge in popularity for
practical implementations, being used for the standard sort routine in the
programming languages Perl, Python (as timsort), and Java (also uses
timsort as of JDK7), among others. Merge sort has been used in Java at
least since 2000 in JDK1.3.
Tree traversal
In computer science, tree traversal refers to the process of visiting
(examining and/or updating) each node in a tree data structure, exactly
once, in a systematic way. Such traversals are classified by the order in
which the nodes are visited.
Binary tree
In computer science, a binary tree is a tree data structure in which each
node has at most two child nodes, usually distinguished as "left" and "right".
Nodes with children are parent nodes, and child nodes may contain
references to their parents. Outside the tree, there is often a reference to
the "root" node (the ancestor of all nodes), if it exists. Any node in the data
structure can be reached by starting at root node and repeatedly following
references to either the left or right child. A tree which does not have any
node other than root node is called a null tree. In a binary tree a degree of
every node is maximum two. A tree with 'n' number of nodes has exactly
'n-1' branches or degree.
AVL tree
In computer science, an AVL tree is a self-balancing binary search tree,
and it was the first such data structure to be invented.[1] In an AVL tree,
the heights of the two child subtrees of any node differ by at most one.
Lookup, insertion, and deletion all take O(log n) time in both the average
and worst cases, where n is the number of nodes in the tree prior to the
operation. Insertions and deletions may require the tree to be rebalanced
by one or more tree rotations. In other words AVL tree is a binary search
tree where the height of the left subtree differs from the height of the right
subtree by at most 1 level, if it exceeds 1 level then rebalancing occurs.
Graph traversal
Graph traversal refers to the problem of visiting all the nodes in a graph in
a particular manner. Tree traversal is a special case of graph traversal. In
contrast to tree traversal, in general graph traversal, each node may have
to be visited more than once, and a root-like node that connects to all other
nodes might not exist.
Dijkstra's algorithm
Dijkstra's algorithm, conceived by Dutch computer scientist Edsger
Dijkstra in 1956 and published in 1959, is a graph search algorithm that
solves the single-source shortest path problem for a graph with
nonnegative edge path costs, producing a shortest path tree. This
algorithm is often used in routing and as a subroutine in other graph
algorithms.
Kruskal's algorithm
Kruskal's algorithm is a greedy algorithm in graph theory that finds
a minimum spanning tree for a connected weighted graph. This means it
finds a subset of the edges that forms a tree that includes every vertex,
where the total weight of all the edges in the tree is minimized. If the graph
is not connected, then it finds a minimum spanning forest (a minimum
spanning tree for each connected component).
Prim's algorithm
In computer science, Prim's algorithm is a greedy algorithm that finds
a minimum spanning tree for a connected weighted undirected graph. This
means it finds a subset of the edges that forms a tree that includes
every vertex, where the total weight of all the edges in the tree is
minimized. The algorithm was developed in 1930 by Czech mathematician
Vojtěch Jarník and later independently by computer scientist Robert C.
Prim in 1957 and rediscovered by Edsger Dijkstrain 1959. Therefore it is
also sometimes called the DJP algorithm, the Jarník algorithm, or
the Prim–Jarník algorithm.
String searching algorithms
In computer science, string searching algorithms, sometimes called string
matching algorithms, are an important class of string algorithmsthat try to
find a place where one or several strings (also called patterns) are found
within a larger string or text. Let Σ be an alphabet (finite set). Formally,
both the pattern and searched text are vectors of elements of Σ. The Σ
may be a usual human alphabet (for example, the letters A through Z in the
Latin alphabet). Other applications may use binary alphabet (Σ = {0,1})
or DNA alphabet (Σ = {A,C,G,T}) in bioinformatics. In practice, how the
string is encoded can affect the feasible string search algorithms. In
particular if a variable width encoding is in use then it is slow (time
proportional to N) to find the Nth character. This will significantly slow down
many of the more advanced search algorithms. A possible solution is to
search for the sequence of code units instead, but doing so may produce
false matches unless the encoding is specifically designed to avoid it.
Knuth–Morris–Pratt
In computer
science,
the Knuth–Morris–Pratt string
searching
algorithm (or KMP algorithm) searches for occurrences of a
"word" W within a main "text string" S by employing the observation that
when a mismatch occurs, the word itself embodies sufficient information to
determine where the next match could begin, thus bypassing
re-examination of previously matched characters.
Boyer–Moore
In computer science, the Boyer–Moore string search algorithm is an
efficient string searching algorithm that is the standard benchmark for
practical string search literature. It was developed by Robert
S.Boyer and J
Strother
Moore in
1977. The algorithm preprocesses the stringbeing searched for (the
pattern), but not the string being searched in (the text). It is thus well-suited
for applications in which the text does not persist across multiple searches.
The Boyer-Moore algorithm uses information gathered during the
preprocess step to skip sections of the text, resulting in a lower constant
factor than many other string algorithms. In general, the algorithm runs
faster as the pattern length increases.
Tower of Hanoi
The Tower of Hanoi (also called the Tower of Brahma or Lucas'
Tower,[1] and sometimes pluralized) is a mathematical game or puzzle. It
consists of three rods, and a number of disks of different sizes which can
slide onto any rod. The puzzle starts with the disks in a neat stack in
ascending order of size on one rod, the smallest at the top, thus making a
conical shape.
The objective of the puzzle is to move the entire stack to another rod,
obeying the following rules:
 Only one disk may be moved at a time.
 Each move consists of taking the upper disk from one of the rods and
sliding it onto another rod, on top of the other disks that may already be
present on that rod.
 No disk may be placed on top of a smaller disk.
Eight queens puzzle
The eight queens’ puzzle is the problem of placing eight chess queens on
an 8×8 chessboard so that no two queens attack each other. Thus, a
solution requires that no two queens share the same row, column, or
diagonal. The eight queens’ puzzle is an example of the more
general n-queens problem of placing n queens on an n×n chessboard,
where solutions exist for all natural numbers n with the exception of 2 and
3.
Support
• For more information about the Android Smart Algorithm app, see
www.com.
• For more information about Algorithm, see
http:// en.wikipedia.org/wiki/List_of_algorithm_general_topics.
• For Android Smart Algorithm documentation, see www. .com/docs
• Send feedback about this app to @gmail.com.
Download