Share on Google+Share on Google+

0 Answer(s)      5 years and 8 months ago
Posted in : Java Beginners

Hi all,

i have a task which is create an algorithm from a java code.and i need help from u guys to check on my algo put a comment on what should i change or why it is wrong.

I really appreciate if u could help me on this matter...

thanks a lot.

here is my algorithm:

input configuration set,S (number of value for p1(v1), number of value for p2(v2),.....number of value for pn (vn))
    number of interaction strength, t
    number of parameter, p
test case suite , A

    initialize binary_list as empty binary set;
    choose binary sets (in parameter order p1,p2,... pn) where number of bit '1' equal to t;
    push binary sets into binary_list;

while binary_list not empty
    for each binary_list: b = binary set
        //count number of value combination base on b;
        initialize count = 1;
        for (i <= p)
            if b(i) = '1';
                count = count * v(i);
            end if
        end for

        initialize repetition = 1;
        for (i<= p)
            if b(i) = '1'
                initialize current_combination = 0;
                initialize temp as an empty set of temporary test set;
                while (current_combination < count)
                    initialize v_o_p = 0;
                    choose value where parameter (i);
                    insert or update v_o_p into temp;
                    repeat same value for repetition time; 
                end while

            repetition = repetition * v(i);

            end if

            else if b(i) = '0'
                choose value from parameter (i) randomly;
                update temp;

        end for

    end for each
end while

//write candidates into final test set

while temp is not empty
    pop 1st test case in temp and push into A;

    for each of test case in temp: tc = test case

        compare tc to test case in A;

            if (compare == 0)
                insert tc into A;
            remove tc in temp;
    end for each
end while


the brief explanation by example:

user input:
set of parameter: A:a1,a2,a3; B:b1,b2,b3; C:c1,c2,c3

number of parameter= 3

the value of each parameter = 3 for A, 3 for B, 3 for C

number of strength,t = 2

the set of binary in this case is = 3 (base on parameter orientation ABC)

1- 011
2- 101
3- 110

operates for each binary set:
example for binary set no 1= 011;
starts from last bit which is '1';
so in empty set named temp for first bit should have:











2nd bit, temp should have (updated temp):










last round for 1st bit is '0', so should select randomly from parameter A's values:










this repeated until all binary sets operated with same operation.

then all data in temp will be compared to each other if no duplicate data, push into final_set. 
View Answers

Related Tutorials/Questions & Answers:
algorithm  convert this algorithm to java code IsSample_PAS: 1.for every attribute value aj belongs to ti do begin (here aj=1,2...,ti=1,2..) 2.if(CF... false; (this is algorithm from ieee paper QUALITY AWARE SAMPLING AND ITS
algorithm  Hi all, i have a task which is create an algorithm from a java code.and i need help from u guys to check on my algo put a comment... on this matter... thanks a lot. here is my algorithm: > Input
Algorithm - Java3D
Algorithm  what is NaiveSimilarity algorithm? How we use this algorithm to recognize a face in face recognition (using Java)? which is the steps involved in this? Which is the database used to store an image
efficiency of an algorithm
efficiency of an algorithm  how can we calculate the best or worst case efficiency of an algorithm
efficiency of an algorithm
efficiency of an algorithm  how can we calculate the best or worst case efficiency of an algorithm
C4.5 ALGORITHM  I am doing my project in data mining.Any body having code for C4.5 decision tree algorithm in java with output.Help me Friends
Conflation Algorithm
Conflation Algorithm  implementation of conflation algorithm is possible using java?? conflation requires file handling a text contains stop words(is,or,and,.,)remove this words remove suffix(ing,ed..) remove equal words count
Problem analysis and algorithm design (i.e.: flowchart, algorithm)
Problem analysis and algorithm design (i.e.: flowchart, algorithm)  Problem analysis and algorithm design (i.e.: flowchart, algorithm)for this question.Write a Java program that prompt user to input a number of students
Algorithm - Java Beginners
Algorithm  (a) Describe the manual procedure, if one has to use the above algorithm and the first element as the pivot to sort the sequence... the algorithm you want to use to sort the sequence. Thanks
Asymmetric algorithm - Java Beginners
Asymmetric algorithm  hybrid Digital image embedding using invisible watermarking with rsa and dct algorithm? please send me this project with source code........ regards subramanian
Version of cn.featherfly>featherfly-algorithm dependency
List of Version of cn.featherfly>featherfly-algorithm dependency
Maven Dependency featherfly-algorithm >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of cn.featherfly >> featherfly-algorithm version1.0.1 in your project
Maven Dependency featherfly-algorithm >> 1.0.2
You should include the dependency code given in this page to add Maven Dependency of cn.featherfly >> featherfly-algorithm version1.0.2 in your project
How to write a rsa algorithm using thread
How to write a rsa algorithm using thread   Hi... This my **rsa algorithm sequential code..can u anyone plz change/convert to concurrent...("Time required for sequential rsa algorithm:"+(endtime-starttime)+"millisecond
implementing an algorithm using multi threads - Java Beginners
implementing an algorithm using multi threads  Hi i need to implement an algorith in multi threads.Algorithm has data dependency so i need to pass data from one thread to another thread. I am posting my algorithm which needs
pattern matching --four way technique........brute force algorithm
pattern matching - four way technique  Hi, here's my question.. I am trying to implement pattern matching using brute force algorithm where I am trying to apply four way technique to search a given pattern in a
Google Penguin Algorithm update issues and How to Recover
of the year 2013 and will "go deeper". Like all other Google algorithm updates
Google Panda 4.0 is rolling out
the search engine, the latest version of search engine algorithm. Google Panda... the previous algorithm update in last year this one also going to hit many... content the algorithm will actually help to avoid the clutter and get better
C array sort example
the implementation of quicksort algorithm to sort the elements of an array. Syntax
Selection Sort in Java
. In selection sorting algorithm, the minimum value in an array is swapped... sort is probably the most spontaneous sorting algorithm. Selection sort... in Java. In selection sort algorithm, first assign minimum index in key as index
Google Penguin 3.0 Launched
algorithm. According to the Google this update will cheer up the webmasters... websites whose ranking is increased and they are celebrating. This algorithm
Google Penguin Update vs. Black Hat SEO
, but it is more important as this new algorithm of Google is to make web user experience... by this new algorithm and this time the target is mainly the spammers and bad links... through its webmaster guidelines and algorithm updates to put it into actual
Insertion Sort Java
Insertion Sort in Java is an algorithm that is used to sort integer values. It can be implemented very easily and is efficient for small data sets. However.... In insertion sorting, algorithm divides the elements in two parts, one which
Google Penguin 2.0: Real SEO Strategy to avoid Penalty
the potential threat of penalty by Penguin 2.0 algorithm update, SEO's... the situation. Following the strictness of Google in the recent Penguin algorithm update... to overcome the threat of Penguin algorithm update penalty and hence followed
JDBC Nested Resultset
JDBC Nested Resultset       The JDBC Nested Result Set  is the simplest join algorithm. In this case for each tuple in the outer join relation, the entire inner
Quick Sort in Java
Quick sort in Java is used to sort integer values of an array. It is a comparison sort. Quick sort is one of the fastest and simplest sorting algorithm...) and in the worst case is Θ(n2). In quick sort algorithm, an element
C# Programming Books
C# Programming Books         Data Structure and Algorithm All rights reserved. No part of this publication may be reproduced
How to Save Your Site from Google Penguin Update
Every Google algorithm has created some uproar among the websites... deep treading algorithm to strike more websites with detrimental practices... already following previous Google algorithm updates, but churned or slightly
Google Penguin Update at a Glance
algorithms latest Google Penguin update is just the algorithm geared towards putting... algorithm update followed by cloaking, duplicate content, bad link scheme


Advertisement null