Algorithms Using Pseudo Code
Not what you're looking for?
1. Write an algorithm, using pseudo code, "Word Search": Given a string of letters, identify all substrings that create one of five given words. For example, if the words (arguments) are: structure; such; system; blue; red, then the string jkdistructuredstrusyssystemoon contains the first, third and fifth words, once each.
2. Write an algorithm, using pseudo code, "Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options. The algorithm can question and re-question the participants, and present the answers to the participants, until a consensus is reached. This exercise is somewhat more open-ended. Add your assumptions if necessary. Obviously, this algorithm might never result in an answer. Deal with that too.
Purchase this Solution
Solution Summary
Algorithms for a word search and a consensus are given in pseudo code.
Solution Preview
Solution for 1st problem
Step 1: Initialize s to the string (which has string in it)
Step 2: Initialize Substr
Step 3: Initialize sLength to length of the string
Step 4: Store the words to search in an array
Step 5: Initialize arrofWords to words of search
Step 6: For I = 1 to ...
Purchase this Solution
Free BrainMass Quizzes
Javscript Basics
Quiz on basics of javascript programming language.
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
Word 2010: Tables
Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.