Question: This is an example of using dictionaries: Can use dictionary to solve this problem? Problem: Equal-Arrays(A,B) Input: arrays A and B of length n different
This is an example of using dictionaries:


Can use dictionary to solve this problem?
Problem: Equal-Arrays(A,B) Input: arrays A and B of length n different order.) Frequencies must also be identical Algorithm 1. Initialize DA, DB 2. For i=1 to n if DA search(A]) NIL DA-nsert(A[i], 1) Else DA.search(Ai)++ 3. Build DB in same way. For i-1 to n . If DA-search(Ali)DB-search(B[i]) return FALSE 5. return TRUE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
