answersLogoWhite

0


Best Answer

Step 00: START.

Step 01: check the lengths of given strings are equal or not.

Step 02: if NO, go to step 12

Step 03: Sort letters of String1

Step 04: Sort letters of String2

Step 05: Get the length 'n' of any string (as they are same anyway)

Step 06: let variable p = '1'

Step 07: compare the letters of both strings at position 'p'

Step 08: if letters MISMATCH, go to step 12

Step 09: check if 'p' is greater than 'n'

Step 10: if NO increment 'p' by 1 and go to step 07

Step 11: OUTPUT à Input string are ANAGRAMS

Step 12: OUTPUT à Input string are NOT ANAGRAMS

Step 13: END

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an algorithm for checking whether two given words are anagrams?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is complsexity of an algorithm?

Complexity of an algorithm is a measure of how long an algorithm would take to complete given


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


Write an algorithm to check whether the given number is odd or even?

Type your answer here... i think we should first enter 1 number then check it


Why algorithm needs to solve programming problem?

This is the definition of an algorithm - a list of orders of how to solve a given programming problem.


What is Vector generation algorithm?

It is a basic algorithm for generating lines on computer screen. line is generated between given 2 endpoints


In term of computer science what is deterministic algorithm?

In computer science, deterministic algorithm is an algorithm which, given a particular input, always produces the same result. This is used to increase the efficiency of machines.


What is the word obtained after unscrambling the word eilf?

The anagrams are lief, life, and file. Also the given name Leif.


Where is there a list of the Lewis Carroll anagrams?

There is no known comprehensive list of Lewis Carroll's anagrams, as he created many throughout his life in various writings. Some famous examples include "I am what I am" rearranged to "Taimataiwhaio," and "I lie" rearranged to "Elle." These anagrams showcase Carroll's clever wordplay and love for puzzles.


What is Textile Anagrams?

Textile anagrams are words or phrases related to the textile industry that can be formed by rearranging the letters of a given word or phrase. This game is a fun way to test your knowledge of textile terminology.


Write an algorithm and draw a corresponding flowchart to find the greatest number and its position among the 6 given numbers?

Algorithm Step1: Read A, B, C Step2: If A > B is True, then check whether A > C, if yes then A is greatest otherwise C is greatest Step3: If A > B is False, then check whether B > C, if yes then B is greatest otherwise C is greatest Give the Flowchart Answer


What is the criteria of algorithm analysis?

The term "analysis of algorithms" was coined by Donald Knuth. Algorithm analysis is an important part of a broader computational complexity theory, which provides theoretical estimates for the resources needed by any algorithm which solves a given computational problem.


What is the word obtained after unscrambling the letters yma?

The anagrams are yam and may, also the proper noun May (fifth month, given name).