Group_A4_Final_Prese..

Download Report

Transcript Group_A4_Final_Prese..

The Fusion Version of
Grouping Process ( Version I )
…………..
Contents





Idea of the Fusion Version
Implementation in C
Analysis of The Fusion Version
Improvement
Clients advice and feedback
Idea of The Fusion Version
-Memory wasting
 In our pervious version
We’re using N Linked-list to represent n
students , and using 4N Pointers.
 Recent improved version
We don’t use the typical array or linkedlist, replace by using a special array
structure.
Idea of Fusion Version (I)
-Introduction.
 Directly linking the next element in
array and labeled the starting address
by using poiners.
…………..
*header
….
K
Idea of Fusion Version (II)
-How to proceed grouping.
 At first, generate N students
randomly, swapping the index Array
and pointed by a header pointer.
 Finally, the last pointer of last
member will point to NULL.
……….
0 1
2 ……..
Idea of Fusion Version (III)
-About random.
 Swapping Process





In order to prevent a search of student records that has
been selected, it is necessary to avoid this situation
An index array is applied for solving this.
Index Array only stores the index of student records that is
still available for grouping.
In order to improve the efficiency, swapping is needed
when the program requires a vacant student record from
the index array, the index of this chosen record will be
swapped to the end and the total length of vacant records
will be decreased.
Consider the orphan situation, how can the program solve
it?
0 1
0 1
2
2
3
3
4
4
5
………...
5 ………...
n
Implementation in C
Analysis of Fusion Version
 It does not require more space as all the
operations will be done on the same
structure.
 Flexibility in number of members and
number of groups.
 Still some swapping is necessary in the
index array. ( reduce time )
 Use the indexed array to store the location
of the index of unselected student records,
it decreases the failure in searching and
improve the efficiency.
 It has a strong data linkage.
Improvement
 Put some functions into C libraries to make it more
organize.
 Array implementation is also possible for this solution.
 Implementation into AVL tree or heaps that can saves
the searching time.
 Reduce searching time by using radix sort or some
other sorting.
 Initialization can be done more efficiently.
 Put all different structures into another larger
structure, it can be more integrated into objectoriented ( similar to encapsulation in JAVA )
programming.
Feedback from Group B3




The combined version really saves the space.
It has a strong data linkage.
Running time is acceptable.
Complicated in understanding the
programming algorithm. May be hard to
understand.
Group A4, Overall Conclusion:
Let’s give the term to
Group B3 for Version II