1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lady_Fox [76]
4 years ago
14

supppose we already have a list called words, containing all the words(i.e., string).Write code that produce a sorted list with

all duplicate words removed. For example, if words ==['hello', 'mother','hello','father','here','i','am','hello'], your code would produce the list ['am','father','hello','here','i','mother'].
Computers and Technology
1 answer:
alexandr402 [8]4 years ago
4 0

Answer:

I will code in Javascript.

<em>//define and initialize both arrays.</em>

var words = ['hello', 'mother','hello','father','here','i','am','hello'];

var sortedList = [];

 

 for ( var i = 0;  i < words.length ; i++ ){  <em>//loop used to go throght the words</em>

   var duplicated = false;  <em>// boolean used for detect duplicates</em>

   for ( var j = i + 1;  j < words.length ; j++ ) {  <em>//loop used to compare with other words</em>

     if( words[i] == words[j] ) {  <em>//if the word is duplicated, duplicated becomes true.</em>

       duplicated = true;

       break;

     }

   }

   if (! duplicated) {  <em>//if at the end of the loop of each word duplicated is false, then the element is pushed into sortedList.</em>

     sortedList.push(words[i]);    

   }

 }

 sortedList.sort(); <em>//when the loop is finished, use the Javascript method to sort an array.</em>

You might be interested in
¿que lenguaje de programacion usan los operadores matematicos?​
kolbaska11 [484]

Answer:

Matlab / GNU Octave. MATLAB (laboratorio de matrices) es un entorno informático numérico multiparadigma y un lenguaje de programación de cuarta generación.

Explanation:

8 0
3 years ago
Read 2 more answers
With _____, the user simply tells the data mining software to uncover whatever patterns and relationships it can find in a data
Ket [755]

Answer:

D) Unsupervised Data mining

Explanation:

Unsupervised data mining also refered to as undirected data mining reveals hidden patterns in unlabeled data. In this method, there are no output variables to predict. The aim of an unsupervised data mining technique is to uncover patterns in data based on the relationship between the data points and each other

5 0
4 years ago
Join my giggl PLEASE i am so bored link will be in comments
asambeis [7]

Answer:

in which app we had to join

5 0
3 years ago
Read 2 more answers
How frequently should computers containing ehr information be backed up?
geniusboy [140]
Explain what is meant by a limited data set and how this HIPAA rule may affect medical assistants
7 0
3 years ago
Which app is used to synchronize data among iOS devices and Windows desktops?
docker41 [41]
ICloud because it links your old device to the new one
4 0
3 years ago
Read 2 more answers
Other questions:
  • Sarah's research shows that business information management professionals also perform the duties of other professionals. Which
    9·1 answer
  • An IT technician has manually configured an IP address on a laptop for a new employee. Each time the employee tries to connect t
    8·1 answer
  • You can access decorative underlines and change their color through the ____ drop-down.
    8·1 answer
  • Each organization that provides host services on the public Internet is responsible for providing and maintaining DNS authoritat
    7·1 answer
  • A _____ is a device that not only provides surge protection, but also furnishes desktop computers and network devices with batte
    7·1 answer
  • PLEASE HELP<br><br><br> i’m doing a internet safety brochure. what is a good hook ?!
    14·1 answer
  • You also learn in class that one kilobyte of computer memory will hold about 2/3 of a page of typical text (without formatting).
    6·1 answer
  • Consider relations A and B. Relation A represents the entity on the ""one side"" of a one-to-many relationship; Relation B repre
    11·1 answer
  • How do you respond to an email?
    6·1 answer
  • How does recorded audio stay on an audio tape
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!