• Subject Name : IT Computer Science


Program to sort a list of arrays from higher to lower order without repeating the values.

Metamorphic relation.

Kinds of metamorphic relation.

Effective metamorphic relation out of all

Program to Sort a List of Arrays from Higher to Lower Order without Repeating the Values



The namespace using as dst;

//this line assists in avoiding and mitigating the repeating and duplicate elements

// this operation also behaves as a modified array and new size of array list

Int remove Duplicates (int arr[], int w)


If (w==0 || w==1)

Return w;

// it assists in storing the new and unique element in the index

Int w=0;

// this assists in maintain another updated index i.e. x

For (int b=0; b<w-1; b++)

If (arr[b] !=arr[b+1]

arr[x++]= arr[b];


Return x;


// now main code starts from here

int main()


Int arr[]= {-1, -2, 3,3,4,4,20, 50, ,-55, 20,-2}

Int w= sizeof (arr)/sizeof(arr[0]);

// this function sort the array from higher to lower values

Sort(arr, arr+w);

// this function will help in eliminating the duplicate elements from the array


// this function assists in printing the novice array

For (int (int b=0; b<w-1; b++))

 cout<<arr[b]<<” “;



Metamorphic Relation

An abstraction of different patterns of various inputs and distinct types of inputs that characterizes the relation among the source of inputs and the source of follow up in the metamorphic relation is said to be metamorphic relation. In this particular metamorphic relation, the sources and the inputs can be numerous and can be infinite.

The testing of metamorphic provides a mechanism to evaluate the program according to the expected result of the analyzed execution is unknown or if it is unable for performing the comparison with the actual values or standards; this result is also known as oracle issue. For solving this oracle issue, instead of evaluating the individual elements of all the results of distinct program, the evaluation of metamorphic program harasses the relation among the result and the input of various executions of infinite programs that is performed under observation. Every relation that comes under metamorphic testing is referred as the metamorphic relation. In other words, metamorphic relations are those relation that programs tests under metamorphic testing.

Every of these relation under metamorphic testing is known as metamorphic relation.

Kinds of Metamorphic Relation

Of talk about the coding area of obfuscators or cybersecurity then there are many types of metamorphic relation. The kinds of metamorphic relation are explained below:

  1. MR1: metamorphic relation consists of two different source programs like M1 and M2. The functionality of both the programs are equivalent, the version of cybersecurity of these two programs can be O(M1) and O(M2)) and the functionality of these versions must also be equal like the functionality of program. Hence, version of obfuscated programs which is compiled as well become an executable code such as is C(O(M1)) and C(O(M2)), both the codes should have similar behavior and offer the same result by giving the same input.
  2. MRorder: this relation depends on the parameters of the queries. If the parameters of the query get changes then the relation of two consecutive queries will be same and next two consecutive relation will also be same and this will go on up to n number and all the queries will give the similar result.
  3. MPReverseJD: this relation works in the reverse queries given in the Mrorder relation. If all the queries set in the reverse order like Qn, Qn-1, and so on then this will give the outcome of the new query and the outcome should be same as given earlier or in this particular relation, similarity of Jaccard can be used.
  4. MR2: this relation is not for those queries that do not have information about the attributes. If a non-informative attribute is added to each sample P and is the follow up of any input Ks then the result of the follow up case will be Ti.
  5. MR5:MR5 is also known as eliminating the classes. If the follow up input is eliminated from the entire class of sample P in which the label is not present Pi then the result of the follow up class must be present in Ki.
  6. MPSite: in this a function called asite:d is used, if there are two queries present p1 and p2 then in asite:d, d presents the name of domain of any page of the website in R(p1) then R(p2)is the subset of R(p1) will give the answer of p1.
  7. MR1Mandatory: in this relation, if p1 is devised from p2 by adding the necessary feature then Km as a child feature of Kp the Π(p1) = Π(p) ∧ ∀p∈ Π(p) * Kp / ∈K ⇒ p∈ Π(p1) ∧ Kp ∈p ⇒ ( p∪{Km} ) ∈ Π(p1)

Effective Metamorphic Relation out Of All

All the metamorphic relation that are defined above are from the user’s perspective. It is an example and that too solid example of exchanging the direction of MRIP i.e. Metamorphic relation input pattern the symmetry Metamorphic relation pattern in which the elements can solved either in increasing order or in decreasing order.

The perfect metamorphic relation is Metamorphic Relation Price Sort and this is the effective out of all seven relations. Let r(x,y) describes the perfect search function where q is the searching criteria and p id is the sorting criteria, then the outcome will give accordingly y. if y1(y2) describes the criteria that assists in sorting the result according to price in decreasing or increasing in sequence then s(x, y1) and r(x, y2) should offer exactly same sets of result but will be reverse order.

Remember, at the center of any academic work, lies clarity and evidence. Should you need further assistance, do look up to our Computer Science Assignment Help

Get It Done! Today

  • 1,212,718Orders

  • 4.9/5Rating

  • 5,063Experts


  • 21 Step Quality Check
  • 2000+ Ph.D Experts
  • Live Expert Sessions
  • Dedicated App
  • Earn while you Learn with us
  • Confidentiality Agreement
  • Money Back Guarantee
  • Customer Feedback

Just Pay for your Assignment

  • Turnitin Report

  • Proofreading and Editing

    $9.00Per Page
  • Consultation with Expert

    $35.00Per Hour
  • Live Session 1-on-1

    $40.00Per 30 min.
  • Quality Check

  • Total

  • Let's Start

500 Words Free
on your assignment today

Browse across 1 Million Assignment Samples for Free

Explore MASS
Order Now

My Assignment Services- Whatsapp Tap to ChatGet instant assignment help

Collect Chat