It’s possible to combine two words into one when you want to convey a specific meaning relating to both. You can turn something like “list” and “article” into “listicle.” This article will explore the best terms you can use to combine two words into one.
The best terms for combining two words into one are “blend word,” “blending,” and “portmanteau word.” These are the best ways to refer to a word that’s been made out of two completely different words. It’s a great way to show that both words impact the new word’s meaning.
1. Blend Word
“Blend word” is a great phrase to use when words are combined into one. It’s an informal construct, allowing you to create new words based on the fundamental sounds and letters that come from two completely different words.
For example, a “blend word” would be “brunch.” It takes “breakfast” and “lunch” and combines the two words into one. This is an efficient way of using both words more recognisably.
“Blending” is the official term for combining words in this way.
It works best informally because you need to overlook specific grammatical rules to accept certain blend words. For example, “frenemy” means “friend” and “enemy.” It’s not an official word, but it’s widely regarded and understood because of how common the blend is.
The definition of “blend word,” according to The Cambridge Dictionary, is “a word formed by combining two other words.”
- I think they called it “chillaxation.” It’s a blend word combining “chill” and “relaxation.” I think it has a ring to it.
- What is it with all these blend words becoming more popular? I’m not sure I can keep up with the youth of today and their lingo.
- I thought of a few new blend words that could work quite well in these contexts. Let me know which ones you like the best.
2. Blending
“Blending” is the term used when combining two words into a shorter form. You can use it to refer to the action of grouping two words as “blending” is the verb gerund form.
“Blend word” is the noun form, and “blending” is the verb. They both mean the same thing. They allow you to group words to create smaller, informal words and phrases that help you get your point across more efficiently.
- Blending words is super easy. You can say something like “sitcom” or “cosplay.” They take little bits and create big words.
- I love blending words to create new ideas. It’s always exciting to come up with words that nobody has thought of before.
- Blending words is a lot of fun when you know what you’re doing. You should try it sometime to see if it works for you.
3. Portmanteau Word
“Portmanteau word” is a great way to refer to two combined words. It has a French origin relating to a suitcase that opens in two equal parts.
“Portmanteau” is French for “carry case” or “suitcase.” It refers to a suitcase that can be opened into two equal parts. It evolved to mean that two words could combine to create a new word and hold a new meaning that takes equal parts from the original word.
It’s a very common way to refer to a blended word. You could combine something like “jeans” and “leggings” into the popular portmanteau word “jeggings.” It takes an equal meaning from both original words to create a new one.
Nowadays, “portmanteau” is much more common to refer to combined words rather than a suitcase. Most native speakers know it as the phrase used when words like “brunch” or “jeggings” are created.
The definition of “portmanteau word,” according to The Cambridge Dictionary, is “a word formed by combining two other words.”
- What portmanteau words do you know? I’ve heard “biopic” lately, and I’ve been pronouncing it wrong for the longest time!
- I think you should come up with a portmanteau word for that. It’s too wordy, and people will remember it easier if it is shortened.
- This portmanteau word comes from “drama” and “comedy.” A “dramedy” is a great form of theatre that you must watch!
4. Coining
“Coining” is a great phrase to use when new words are developed. It doesn’t refer to combining two words, but it allows you to “coin” a new word if you’ve made one yourself.
For example, if you combine “breakfast” and “lunch” into “brunch,” you could “coin” that word. However, it only applies when you are the first person to do it. Since “brunch” is already accepted as a portmanteau word, you can’t “coin” it yourself.
That doesn’t mean you can’t try to find other words that you can “coin.” There’s no limit to what words you can combine.
- I’m coining a new word from these two. It’s stupid to have to say them individually after all this time.
- You should try coining your own blend of the words. I think it’ll be really interesting to come up with something new.
- He’s managed to coin that word on his own. I was quite surprised that he was able to be that creative with it.
5. Compounding
“Compounding” refers to combining two words into one. However, it works very differently from the other words in this article. You need to know the difference before using “compounding” correctly.
“Compounding” takes two full words and combines them without removing any letters. For example, “back” and “drop” can compound to become “backdrop.”
You cannot call it “compounding” when combining two words into a more informal word (i.e. “chill” and “relax” becoming “chillax” is not compounding).
“Compounding” is the official grammatical term used when two words combine to become a compound noun or adjective. You might also find a hyphen comes between the words (mainly when using adjectives).
- Compounding words only work when you need them to be in the same breath. Something like “football” or “cupcake” works here.
- You should try compounding those words. They’re used together enough times that people expect them to be written like that.
- I’m not sure what compounding those words is going to do for the sentence. You should try something else.
Martin holds a Master’s degree in Finance and International Business. He has six years of experience in professional communication with clients, executives, and colleagues. Furthermore, he has teaching experience from Aarhus University. Martin has been featured as an expert in communication and teaching on Forbes and Shopify. Read more about Martin here.
For the case with two words, the problem can be solved by just considering all possible ways of splitting the word into two, then checking each half to see if it’s a valid word. If the input string has length n, then there are only O(n) different ways of splitting the string. If you store the strings in a structure supporting fast lookup (say, a trie, or hash table).
The more interesting case is when you have k > 2 words to split the word into. For this, we can use a really elegant recursive formulation:
A word can be split into k words if it can be split into a word followed by a word splittable into k — 1 words.
The recursive base case would be that a word can be split into zero words only if it’s the empty string, which is trivially true.
To use this recursive insight, we’ll modify the original algorithm by considering all possible splits of the word into two parts. Once we have that split, we can check if the first part of the split is a word and if the second part of the split can be broken apart into k — 1 words. As an optimization, we don’t recurse on all possible splits, but rather just on those where we know the first word is valid. Here’s some sample code written in Java:
public static boolean isSplittable(String word, int k, Set<String> dictionary) {
/* Base case: If the string is empty, we can only split into k words and vice-
* versa.
*/
if (word.isEmpty() || k == 0)
return word.isEmpty() && k == 0;
/* Generate all possible non-empty splits of the word into two parts, recursing on
* problems where the first word is known to be valid.
*
* This loop is structured so that we always try pulling off at least one letter
* from the input string so that we don't try splitting the word into k pieces
* of which some are empty.
*/
for (int i = 1; i <= word.length(); ++i) {
String first = word.substring(0, i), last = word.substring(i);
if (dictionary.contains(first) &&
isSplittable(last, k - 1, dictionary)
return true;
}
/* If we're here, then no possible split works in this case and we should signal
* that no solution exists.
*/
return false;
}
}
This code, in the worst case, runs in time O(nk) because it tries to generate all possible partitions of the string into k different pieces. Of course, it’s unlikely to hit this worst-case behavior because most possible splits won’t end up forming any words.
For example, therapist may be split into the + rapist, neither of which (arguably) has anything to do with the original words.
Another example would be conflagration: con + flag + ration. Or weather: we + at + her.
Note that words like threesome and purebred would not qualify, because the parts are intentional and contribute to the original word’s meaning.
It seems to me there might be a word for this, which I would describe as «accidental lexical componentry» — but I’m not sure there is one. And if I do think of one I will be sure to add a supplemental (supple + mental) section (sect + ion) to this question (quest + ion).
Helmar
5,3497 gold badges31 silver badges66 bronze badges
asked Dec 29, 2012 at 17:03
11
They are called redividers or redivided words:
(puzzles) A sequence of letters that can be segmented into two or more different sentences
2001, David B. Searls, “From Jabberwocky to Genome: Lewis Carroll and Computational Biology”, Journal of Computational Biology, volume 8, number 3, page 344:
Latter-day puzzle makers in a direct lineage from Carroll’s tradition and even more extreme instances of segmentation oddities in what are called redividers (Michaelsen, 1998), for example, observing that the sentence “In every ode linger many” can be resegmented to read “I never yodel in Germany” (Shortz, 1997); such cases serve to point out the duality of the problems of gap assignment and boundary detection, and also inject a combinatorial flavor.
They are apparently also known as charades. Quoting from The Dictionary of Wordplay by Dave Morice:
A few wordplay terms were especially problematic. Recently some writers have tried to upgrade some of the older, more traditional terminology. Some believe that pyramid should be replaced with triangle. Some feel that redivider should replace charade. The terms in the dictionary are usually those that have appeared most often in print. Any other terms may be listed as synonyms, or they may appear as separate entries with a brief notation that cross-references them to the older terms.
There are a number of domain names which have become infamous thanks to their … redivisibility:
- therapistfinder.com
- penisland.com
- expertsexchange.com
- powergenitalia.com
- whorepresents.com
answered Dec 30, 2012 at 5:23
coleopteristcoleopterist
30.7k28 gold badges114 silver badges199 bronze badges
0
As a humorous neologism, you might call them polyparses.
answered Dec 31, 2012 at 17:14
Kit Z. Fox♦Kit Z. Fox
27.6k23 gold badges110 silver badges187 bronze badges
3
The terms pun, false segmentation, and metanalysis are used in discussion of the phenomenon in p. 132 of Attardo’s Linguistic Theories of Humor, which cites several other works that might be worth consulting.
answered Dec 29, 2012 at 17:12
Note: . Anagrams are meaningful words made after rearranging all the letters of the word.
Search More words for viewing how many words can be made out of them
Note
There are 1 vowel letters and 2 consonant letters in the word two. T is 20th, W is 23rd, O is 15th, Letter of Alphabet series.
Wordmaker is a website which tells you how many words you can make out of any given word in english language. we have tried our best to include every possible word combination of a given word. Its a good website for those who are looking for anagrams of a particular word. Anagrams are words made using each and every letter of the word and is of the same length as original english word. Most of the words meaning have also being provided to have a better understanding of the word. A cool tool for scrabble fans and english users, word maker is fastly becoming one of the most sought after english reference across the web.
Given a dictionary find out if given word can be made by two words in the dictionary.
Note: Words in the dictionary must be unique and the word to be formed should not be a repetition of same words that are present in the Trie.
Examples:
Input : dictionary[] = {"news", "abcd", "tree", "geeks", "paper"} word = "newspaper" Output : Yes We can form "newspaper" using "news" and "paper" Input : dictionary[] = {"geeks", "code", "xyz", "forgeeks", "paper"} word = "geeksforgeeks" Output : Yes Input : dictionary[] = {"geek", "code", "xyz", "forgeeks", "paper"} word = "geeksforgeeks" Output : No
The idea is store all words of dictionary in a Trie. We do prefix search for given word. Once we find a prefix, we search for rest of the word.
Algorithm :
1- Store all the words of the dictionary in a Trie. 2- Start searching for the given word in Trie. If it partially matched then split it into two parts and then search for the second part in the Trie. 3- If both found, then return true. 4- Otherwise return false.
Below is the implementation of above idea.
C++
#include<bits/stdc++.h>
using
namespace
std;
#define char_int(c) ((int)c - (int)'a')
#define SIZE (26)
struct
TrieNode
{
TrieNode *children[SIZE];
bool
isLeaf;
};
TrieNode *getNode()
{
TrieNode * newNode =
new
TrieNode;
newNode->isLeaf =
false
;
for
(
int
i =0 ; i< SIZE ; i++)
newNode->children[i] = NULL;
return
newNode;
}
void
insert(TrieNode *root, string Key)
{
int
n = Key.length();
TrieNode * pCrawl = root;
for
(
int
i=0; i<n; i++)
{
int
index = char_int(Key[i]);
if
(pCrawl->children[index] == NULL)
pCrawl->children[index] = getNode();
pCrawl = pCrawl->children[index];
}
pCrawl->isLeaf =
true
;
}
int
findPrefix(
struct
TrieNode *root, string key)
{
int
pos = -1, level;
struct
TrieNode *pCrawl = root;
for
(level = 0; level < key.length(); level++)
{
int
index = char_int(key[level]);
if
(pCrawl->isLeaf ==
true
)
pos = level;
if
(!pCrawl->children[index])
return
pos;
pCrawl = pCrawl->children[index];
}
if
(pCrawl != NULL && pCrawl->isLeaf)
return
level;
}
bool
isPossible(
struct
TrieNode* root, string word)
{
int
len = findPrefix(root, word);
if
(len == -1)
return
false
;
string split_word(word, len, word.length()-(len));
int
split_len = findPrefix(root, split_word);
return
(len + split_len == word.length());
}
int
main()
{
vector<string> dictionary = {
"geeks"
,
"forgeeks"
,
"quiz"
,
"geek"
};
string word =
"geeksquiz"
;
TrieNode *root = getNode();
for
(
int
i=0; i<dictionary.size(); i++)
insert(root, dictionary[i]);
isPossible(root, word) ? cout <<
"Yes"
:
cout <<
"No"
;
return
0;
}
Java
import
java.util.ArrayList;
import
java.util.List;
public
class
GFG {
final
static
int
SIZE =
26
;
static
class
TrieNode
{
TrieNode[] children =
new
TrieNode[SIZE];
boolean
isLeaf;
public
TrieNode() {
isLeaf =
false
;
for
(
int
i =
0
; i< SIZE ; i++)
children[i] =
null
;
}
}
static
TrieNode root;
static
void
insert(TrieNode root, String Key)
{
int
n = Key.length();
TrieNode pCrawl = root;
for
(
int
i=
0
; i<n; i++)
{
int
index = Key.charAt(i) -
'a'
;
if
(pCrawl.children[index] ==
null
)
pCrawl.children[index] =
new
TrieNode();
pCrawl = pCrawl.children[index];
}
pCrawl.isLeaf =
true
;
}
static
List<Integer> findPrefix(TrieNode root, String key)
{
List<Integer> prefixPositions =
new
ArrayList<Integer>();
int
level;
TrieNode pCrawl = root;
for
(level =
0
; level < key.length(); level++)
{
int
index = key.charAt(level) -
'a'
;
if
(pCrawl.isLeaf ==
true
)
prefixPositions.add(level);
if
(pCrawl.children[index] ==
null
)
return
prefixPositions;
pCrawl = pCrawl.children[index];
}
if
(pCrawl !=
null
&& pCrawl.isLeaf)
prefixPositions.add(level);
return
prefixPositions;
}
static
boolean
isPossible(TrieNode root, String word)
{
List<Integer> prefixPositions1 = findPrefix(root, word);
if
(prefixPositions1.isEmpty())
return
false
;
for
(Integer len1 : prefixPositions1) {
String restOfSubstring = word.substring(len1, word.length());
List<Integer> prefixPositions2 = findPrefix(root, restOfSubstring);
for
(Integer len2 : prefixPositions2) {
if
(len1 + len2 == word.length())
return
true
;
}
}
return
false
;
}
public
static
void
main(String args[])
{
String[] dictionary = {
"news"
,
"newspa"
,
"paper"
,
"geek"
};
String word =
"newspaper"
;
root =
new
TrieNode();
for
(
int
i=
0
; i<dictionary.length; i++)
insert(root, dictionary[i]);
if
(isPossible(root, word))
System.out.println(
"Yes"
);
else
System.out.println(
"No"
);
}
}
Python3
class
TrieNode:
def
__init__(
self
):
self
.children
=
[
None
]
*
26
self
.isLeaf
=
False
def
charToInt(ch):
return
ord
(ch)
-
ord
(
'a'
)
def
insert(root, key):
pCrawl
=
root
for
ch
in
key:
index
=
charToInt(ch)
if
not
pCrawl.children[index]:
pCrawl.children[index]
=
TrieNode()
pCrawl
=
pCrawl.children[index]
pCrawl.isLeaf
=
True
def
findPrefix(root, key):
pos
=
-
1
pCrawl
=
root
for
i, ch
in
enumerate
(key):
index
=
charToInt(ch)
if
pCrawl.isLeaf:
pos
=
i
if
not
pCrawl.children[index]:
return
pos
pCrawl
=
pCrawl.children[index]
return
len
(key)
def
isPossible(root, word):
len1
=
findPrefix(root, word)
if
len1
=
=
-
1
:
return
False
split_word
=
word[len1:]
len2
=
findPrefix(root, split_word)
return
len1
+
len2
=
=
len
(word)
if
__name__
=
=
"__main__"
:
dictionary
=
[
"geeks"
,
"forgeeks"
,
"quiz"
,
"geek"
]
word
=
"geeksquiz"
root
=
TrieNode()
for
key
in
dictionary:
insert(root, key)
print
(
"Yes"
if
isPossible(root, word)
else
"No"
)
C#
using
System;
using
System.Collections.Generic;
class
GFG
{
readonly
public
static
int
SIZE = 26;
public
class
TrieNode
{
public
TrieNode []children =
new
TrieNode[SIZE];
public
bool
isLeaf;
public
TrieNode()
{
isLeaf =
false
;
for
(
int
i = 0 ; i < SIZE ; i++)
children[i] =
null
;
}
}
static
TrieNode root;
static
void
insert(TrieNode root, String Key)
{
int
n = Key.Length;
TrieNode pCrawl = root;
for
(
int
i = 0; i < n; i++)
{
int
index = Key[i] -
'a'
;
if
(pCrawl.children[index] ==
null
)
pCrawl.children[index] =
new
TrieNode();
pCrawl = pCrawl.children[index];
}
pCrawl.isLeaf =
true
;
}
static
List<
int
> findPrefix(TrieNode root, String key)
{
List<
int
> prefixPositions =
new
List<
int
>();
int
level;
TrieNode pCrawl = root;
for
(level = 0; level < key.Length; level++)
{
int
index = key[level] -
'a'
;
if
(pCrawl.isLeaf ==
true
)
prefixPositions.Add(level);
if
(pCrawl.children[index] ==
null
)
return
prefixPositions;
pCrawl = pCrawl.children[index];
}
if
(pCrawl !=
null
&& pCrawl.isLeaf)
prefixPositions.Add(level);
return
prefixPositions;
}
static
bool
isPossible(TrieNode root, String word)
{
List<
int
> prefixPositions1 = findPrefix(root, word);
if
(prefixPositions1.Count==0)
return
false
;
foreach
(
int
len1
in
prefixPositions1)
{
String restOfSubstring = word.Substring(len1,
word.Length-len1);
List<
int
> prefixPositions2 = findPrefix(root,
restOfSubstring);
foreach
(
int
len2
in
prefixPositions2)
{
if
(len1 + len2 == word.Length)
return
true
;
}
}
return
false
;
}
public
static
void
Main(String []args)
{
String[] dictionary = {
"news"
,
"newspa"
,
"paper"
,
"geek"
};
String word =
"newspaper"
;
root =
new
TrieNode();
for
(
int
i = 0; i < dictionary.Length; i++)
insert(root, dictionary[i]);
if
(isPossible(root, word))
Console.WriteLine(
"Yes"
);
else
Console.WriteLine(
"No"
);
}
}
Javascript
<script>
let SIZE = 26;
class TrieNode
{
constructor()
{
this
.isLeaf =
false
;
this
.children =
new
Array(SIZE);
for
(let i = 0 ; i < SIZE; i++)
this
.children[i] =
null
;
}
}
let root;
function
insert(root, Key)
{
let n = Key.length;
let pCrawl = root;
for
(let i = 0; i < n; i++)
{
let index = Key[i].charCodeAt(0) -
'a'
.charCodeAt(0);
if
(pCrawl.children[index] ==
null
)
pCrawl.children[index] =
new
TrieNode();
pCrawl = pCrawl.children[index];
}
pCrawl.isLeaf =
true
;
}
function
findPrefix(root, key)
{
let prefixPositions = [];
let level;
let pCrawl = root;
for
(level = 0; level < key.length; level++)
{
let index = key[level].charCodeAt(0) -
'a'
.charCodeAt(0);
if
(pCrawl.isLeaf ==
true
)
prefixPositions.push(level);
if
(pCrawl.children[index] ==
null
)
return
prefixPositions;
pCrawl = pCrawl.children[index];
}
if
(pCrawl !=
null
&& pCrawl.isLeaf)
prefixPositions.push(level);
return
prefixPositions;
}
function
isPossible(root, word)
{
let prefixPositions1 = findPrefix(root, word);
if
(prefixPositions1.length == 0)
return
false
;
for
(let len1 = 0;
len1 < prefixPositions1.length;
len1++)
{
let restOfSubstring = word.substring(
prefixPositions1[len1], word.length);
let prefixPositions2 = findPrefix(
root, restOfSubstring);
for
(let len2 = 0;
len2 < prefixPositions2.length;
len2++)
{
if
(prefixPositions1[len1] +
prefixPositions2[len2] == word.length)
return
true
;
}
}
return
false
;
}
let dictionary = [
"news"
,
"newspa"
,
"paper"
,
"geek"
];
let word =
"newspaper"
;
root =
new
TrieNode();
for
(let i = 0; i < dictionary.length; i++)
insert(root, dictionary[i]);
if
(isPossible(root, word))
document.write(
"Yes"
);
else
document.write(
"No"
);
</script>
Output:
Yes
Exercise :
A generalized version of the problem is to check if a given word can be formed using concatenation of 1 or more dictionary words. Write code for the generalized version.
Time Complexity: The time complexity of the given program is O(MN), where M is the length of the given word and N is the number of words in the dictionary. This is because the program needs to traverse the given word and perform a prefix search in the trie for each substring of the word, which takes O(M) time. Additionally, the program needs to insert all the words in the dictionary into the trie, which takes O(NM) time.
Auxiliary Space: The space complexity of the program is O(NM), where N is the number of words in the dictionary and M is the maximum length of a word in the dictionary. This is because the program needs to store the trie data structure, which requires O(NM) space.
Another Approach
The above approach is implementing the Trie data structure to efficiently store and search the dictionary words. However, we can optimize the code by using the unordered_set data structure instead of Trie. The unordered_set is a hash-based data structure that has an average constant time complexity O(1) for insertion and search operations. Therefore, it can be used to efficiently search for words in the dictionary.
Approach:
- Check if the given word exists in the dictionary. If it does, return true.
- If the given word is not found in the dictionary, then check if it can be formed by concatenating two or more words from the dictionary recursively.
- To check if a word can be formed by concatenating two or more words from the dictionary, the code splits the word into a prefix and a suffix at every possible position and then checks if the prefix exists in the dictionary.
- If the prefix exists in the dictionary, then the suffix is checked recursively to see if it can be formed by concatenating two or more words from the dictionary. This is done by calling the “isPossible” function recursively with the suffix and the dictionary as input.
- If the suffix can be formed by concatenating two or more words from the dictionary, then the entire word can be formed by concatenating the prefix and suffix. In this case, the function returns true.
- If none of the prefixes can be found in the dictionary, or if none of the suffixes can be formed by concatenating two or more words from the dictionary, then the function returns false.
Algorithm:
This code uses recursion to check whether a given word can be formed by concatenating two words from a given dictionary.
- The function “isPossible” takes two parameters: an unordered_set “dict” containing the dictionary of words and a string word to be checked.
- If the word is found in the dictionary, the function returns true. Otherwise, it recursively checks all possible prefixes and suffixes of the word to see if they can be formed by concatenating two words from the “dict”.
- The recursion stops when either the prefix is not found in the dictionary, or the suffix cannot be formed by concatenating two words from the “dict”.
- If the word can be formed by concatenating two words from the “dict”, the function returns true. Otherwise, it returns false.
- The “main” function creates an “unordered_set” of strings containing the dictionary, and then calls the “isPossible” function to check if the given word can be formed by concatenating two words from the dictionary. Finally, it prints “Yes” if the word can be formed, and “No” otherwise.
Below is the implementation of the above approach:
C++
#include <bits/stdc++.h>
using
namespace
std;
bool
isPossible(unordered_set<string>& dict, string word)
{
if
(dict.find(word) != dict.end())
return
true
;
int
n = word.length();
for
(
int
i = 1; i < n; i++) {
string prefix = word.substr(0, i);
string suffix = word.substr(i);
if
(dict.find(prefix) != dict.end() && isPossible(dict, suffix))
return
true
;
}
return
false
;
}
int
main()
{
unordered_set<string> dictionary = {
"geeks"
,
"forgeeks"
,
"quiz"
,
"geek"
};
string word =
"geeksquiz"
;
isPossible(dictionary, word) ? cout <<
"Yes"
: cout <<
"No"
;
return
0;
}
Java
import
java.util.*;
public
class
WordFormation {
public
static
boolean
isPossible(Set<String> dict, String word) {
if
(dict.contains(word))
return
true
;
int
n = word.length();
for
(
int
i =
1
; i < n; i++) {
String prefix = word.substring(
0
, i);
String suffix = word.substring(i);
if
(dict.contains(prefix) && isPossible(dict, suffix))
return
true
;
}
return
false
;
}
public
static
void
main(String[] args) {
Set<String> dictionary =
new
HashSet<String>();
dictionary.add(
"geeks"
);
dictionary.add(
"forgeeks"
);
dictionary.add(
"quiz"
);
dictionary.add(
"geek"
);
String word =
"geeksquiz"
;
System.out.println(isPossible(dictionary, word) ?
"Yes"
:
"No"
);
}
}
Python3
import
itertools
def
isPossible(
dict
, word):
if
word
in
dict
:
return
True
for
i
in
range
(
1
,
len
(word)):
prefix
=
word[:i]
suffix
=
word[i:]
if
prefix
in
dict
and
isPossible(
dict
, suffix):
return
True
return
False
if
__name__
=
=
'__main__'
:
dictionary
=
{
'geeks'
,
'forgeeks'
,
'quiz'
,
'geek'
}
word
=
'geeksquiz'
if
isPossible(dictionary, word):
print
(
"Yes"
)
else
:
print
(
"No"
)
C#
using
System;
using
System.Collections.Generic;
public
class
WordFormation {
public
static
bool
IsPossible(HashSet<
string
> dict,
string
word) {
if
(dict.Contains(word))
return
true
;
int
n = word.Length;
for
(
int
i = 1; i < n; i++) {
string
prefix = word.Substring(0, i);
string
suffix = word.Substring(i);
if
(dict.Contains(prefix) && IsPossible(dict, suffix))
return
true
;
}
return
false
;
}
public
static
void
Main() {
HashSet<
string
> dictionary =
new
HashSet<
string
>();
dictionary.Add(
"geeks"
);
dictionary.Add(
"forgeeks"
);
dictionary.Add(
"quiz"
);
dictionary.Add(
"geek"
);
string
word =
"geeksquiz"
;
Console.WriteLine(IsPossible(dictionary, word) ?
"Yes"
:
"No"
);
}
}
Javascript
function
isPossible(dict, word) {
if
(dict.has(word)) {
return
true
;
}
let n = word.length;
for
(let i = 1; i < n; i++) {
let prefix = word.substring(0, i);
let suffix = word.substring(i);
if
(dict.has(prefix) && isPossible(dict, suffix)) {
return
true
;
}
}
return
false
;
}
let dictionary =
new
Set([
"geeks"
,
"forgeeks"
,
"quiz"
,
"geek"
]);
let word =
"geeksquiz"
;
isPossible(dictionary, word) ? console.log(
"Yes"
) : console.log(
"No"
);
Output:
Yes
Time Complexity: The time complexity of the “isPossible” function in this code is O(N^3), where N is the length of the input word. This is because, in the worst case, the function will need to check every possible partition of the word into two parts, which is O(N^2), and for each partition, it may need to recursively check both parts, which can take an additional O(N) time.
Auxiliary Space: The space complexity of this function is also O(N^3) in the worst case, due to the recursion stack. Specifically, in the worst case, the recursion depth will be O(N), and at each level of the recursion, the function may need to store a string of length up to N. Therefore, the overall space complexity is O(N^3).
This article is contributed by Sahil Chhabra (akku). If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Make up one word out of two.
Example — grandmother, foot work , hop noon , leap frog , after scotch , home father , grand ball.
На этой странице сайта вы найдете ответы на вопрос Make up one word out of two?,
относящийся к категории Английский язык. Сложность вопроса соответствует базовым
знаниям учеников 1 — 4 классов. Для получения дополнительной информации
найдите другие вопросы, относящимися к данной тематике, с помощью поисковой
системы. Или сформулируйте новый вопрос: нажмите кнопку вверху страницы, и
задайте нужный запрос с помощью ключевых слов, отвечающих вашим критериям.
Общайтесь с посетителями страницы, обсуждайте тему. Возможно, их ответы
помогут найти нужную информацию.
Word Generator is the perfect tool to create words. Be you in search of a Scrabble word generator or just in need of some random words, the device generates all possible words from the given letters. Try it and transform random letters into winning words!
The Essential Guide to Using Word Solvers
Are you looking for a random word generator?
Whether you are playing a word game or just challenging your friends, a world solver is the thing you need. Curious about how these generators work and help you win? Let’s find out!
What is a Word Generator — Word Solver Definition
In a nutshell, a word generator is a tool that helps you to find words. It generates all possible words from your letters and by doing so, helps you discover new ones. People use word solvers for various reasons, but the main aim is always the same — to make words from your input letters.
Our word solver is quick and user-friendly, in a few milliseconds, you can get a list of all possible words that can help you beat your friends at a game or win at challenges. So any time you are stuck with words, get help from a word generator.
How to Use a Word Generator App — 3 Simple Steps
All word generators, whether it’s a word solver, word cheat website, or unscramble app, work on the same principle. You enter the letters you have ended up with into the word solver box to create new words. Here’s a detailed explanation of how to use an online cheat word helper.
Step 1. Check the Letters or Tiles
If you are playing a board game, check the letters you have got. You will probably have some tiles containing letters, vowels, consonants, syllables, and more. If you are trying to make new words, then decide which alphabets you are going to use.
Let’s take an example to illustrate the process. Let’s say you have got the letters M, A, R, T, Y, R, O, L.
Step 2: Enter the Letters in the Search Box
All word solvers will have a blank space or box to enter the letters. Your job is to type in all the letters you will use to spell the word. Now the next task depends on what you are using.
- If you are using a word cheat website, press enter or go beside the search box
- For word generator apps, press the search button
So following our example, type in the letters M, A, R, T, Y, R, O, L. Press enter and wait for the results to load.
Step 3: Check Out the Word List
Now the word maker will display the results according to the word length from the letters given. If we use the letters in our example, the word finder result will include
6-Letter Words
- Rotary
- Martyr
4-Letter Words
- Mortal
- Armory
3-Letter Words
- Mortar
Now you can use the words to earn points and win word games for free!
How to Make Words Online
The first thing you will want to do is to find a word generator. You can do a simple Google to get a list of word jumble generator sites and apps.
Then you need to follow the exact steps we discussed above to generate new words using the word grabber. For example, let’s assume you are trying to make words with the letters D, E, T, O, I, R.
The next thing you do is to
- Enter the letters in the search box
- Press enter or go
- Get your results
So here, the letter combination generator will display words like
- Editor
- Rioted
- Tie
- Rod
- Toe
- Dot
- Ire
How to Use Word Solver for Multiple Letters
Have you ended up with too many letters in your hands?
You have nothing to worry about as the unscramble generator will ease your troubles! No matter how many letters you’ve got, the 3,4,5,6,7 letter word generator will do its job. We will take an example to show you how.
8 Letter Example
We will take the letters C, T, I, N, M, A, R and O. Here we have 8 letters.
Now you know what to do — enter the letters in the box and hit go!
Doing so gives you new words that include
- Romantic
- Carotin
- Atomic
- Carton
- Train
- Ratio
- Coat
- Tram
- Air
- Ran
So you again have a list of words grouped by length to win your game!
A word solver is ideal when you have to make new words, no matter how you are going to use them.