Answer to Question #158813 in Algorithms for talha shahid

Question #158813

Consider the following two sample codes in different language for software complexity analysis using Halstead matrics. Calculate the length, vocabulary, volume, difficulty, Effort, time, and number of delivered Bugs of each code. Create a comparison chart of time, Effort, bugs, and difficulty using any language. Use the below Table to compare Halstead matrics analysis of both example. Halstead Matrics Code 1 Code 2 N1 N2 n1 n2 Length (N) Vocabulary (n) Volume (V) Difficulty (D) Effort (E) Time Bugs Sample code 1 in Java: import java.util.HashSet; // program to remove duplicate values from the array public class DuplicateDetection { // method to remove duplicates static void removeDuplicate(int arr []) { HashSet uniqueSet = new HashSet<>(); for (int i = 0; i < arr.length; i++) { //check whether value exist already or not if(!uniqueSet.add(new Integer(arr[i]))){ System.out.println("Duplicate found : "+ arr[i]); continue; } } // print all unique value of the array for (Integer integer : uniqueSet) { System.out.println(integer); } } public static void main(String[] args) { // take integer array as an input int arr [] = {3,6,2,8,5,9,3,2,0,5,7}; // calling method to remove duplicates removeDuplicate(arr); } } Sample code 2 in Python: # program to remove duplicate value of the array # function to remove duplicates def removeduplicates(arr): s = set() for value in arr: # check whether value already exist or not if value in s: print("Duplicate found ", value) s.add(value) #printing unique values of array print(s) #take array as an input arr = [2,5,6,2,7,4,7,3,5,5] 


1
Expert's answer
2021-01-28T17:47:44-0500
Dear talha shahid, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS