Question

In: Computer Science

State a data structure that is suitable for storing (i) the words in a dictionary to...

State a data structure that is suitable for storing
(i) the words in a dictionary to facilitate searching
(ii) the set of folders you have in your computer
Explain your choices.

Solutions

Expert Solution

i) I prefer ternary tree. Hash table is a data structure that is suitable for storing the words in a dictionary .But it doesn't support prefix searching.Prefix search is a letter or set of letters where a user types and your dictionary shows all words starting with that prefix. but hash table doesn't support prefix searching.

In this scenario, Ternary is used.Ternary is a data structure which facilitates the efficient retrieval of data.And it supports storing(insertion),prefix search, alphabetical order printing and nearest neighbour search etc. Time complexity of search operation in ternary tree is O(h) where h is height of the tree.

ii) Mainly, Trees are used for storing folders in a computer. I prefer B tree for storing the set of folders in the computer.And it also facilitates  quick random access to an block in a particular file.Because you can store both keys and data in the internal and leaf nodes .So we can store set of folders and files.


Related Solutions

here i have a dictionary with the words and i have to find the words with...
here i have a dictionary with the words and i have to find the words with the largest size, (i mean word count for eg abdominohysterectomy) which have anagrams , like for example ,loop -> pool. Also , i have to sort them in alphabetical way so what could be the algorithm for that public class Anagrams {    private static final int MAX_WORD_LENGTH = 25;    private static IArray<IVector<String>> theDictionaries =        new Array<>(MAX_WORD_LENGTH);    public static void...
write a java program that implements the splay tree data structure for the dictionary abstract data...
write a java program that implements the splay tree data structure for the dictionary abstract data type. Initially the program reads data from "in.dat", and establishes an ordinary binary search tree by inserting the data into the tree. The data file contains integers, one per line. in.dat file contents: 3456 5678 1234 2369 7721 3354 1321 4946 3210 8765 Then the program starts an interactive mode. The commands are as follows. S 1000 - splay the tree at 1000 F...
I have a C++ question. I'm reading words from a text file and storing each words...
I have a C++ question. I'm reading words from a text file and storing each words in an array. Currently I'm doing it like the code below and its working fine but I need all the words to be stored in the array as lower case letters. How can I do this? Thank you. if(file.is_open())     {         for(int i = 0; i < arrayLength; i++)         {             file >> array[i];         }     }
The dictionary is the most natural data structure to hold the apple information from the previous...
The dictionary is the most natural data structure to hold the apple information from the previous lesson. Below are the parallel arrays that track a different attribute of the apples (note that the above chart (Sweet-Tart Chart) doesn't align with the data from the previous lesson): names = ["McIntosh", "Red Delicious", "Fuji", "Gala", "Ambrosia", "Honeycrisp", "Granny Smith"] sweetness = [3, 5, 8, 6, 7, 7.5, 1] tartness = [7, 1, 3, 1, 1, 8, 10] Step 1: Data Model (parallel...
Description of Variables/Data Dictionary: The following table is a data dictionary that describes the variables and...
Description of Variables/Data Dictionary: The following table is a data dictionary that describes the variables and their locations in this dataset (Note: Dataset is on second page of this document): Variable Name Location in Dataset Variable Description Coding UniqueID# First Column Unique number used to identify each survey responder Each responder has a unique number from 1-30 SE-MaritalStatus Second Column Marital Status of Head of Household Not Married/Married SE-Income Third Column Total Annual Household Income Amount in US Dollars SE-AgeHeadHousehold...
Sometimes a data dictionary is called as ‘the database designer’s database’. State and explain your opinion...
Sometimes a data dictionary is called as ‘the database designer’s database’. State and explain your opinion regarding this term and support your position using real-life scenarios.
Put a metric ρ on all the words in a dictionary by defining the distance between...
Put a metric ρ on all the words in a dictionary by defining the distance between two distinct words to be 2^−n if the words agree for the first n letters and are different at the (n+1)st letter. A space is distinct from a letter. E.g., ρ(car,cart)=2^−3 and ρ(car,call)=2^−2. a) Verify that this is a metric. b) Suppose that words w1, w2 and w3 are listed in alphabetical order. Find a formula for ρ(w1,w3) in terms of ρ(w1,w2) and ρ(w2,w3).
Please, I need resturant like authentic food, anything suitable with this is fine. Your data models...
Please, I need resturant like authentic food, anything suitable with this is fine. Your data models must consist of entity lists and entity-relationship diagrams for: 1. Food items (meals/dishes) the restaurants serve o 3 to 5 food types 2. Facilities and equipment 3. Employee work hours and salaries 4. Tracking day-to-day cash flow o Income and spending 5. Competitive o Renovation cost and extra earned income o Promotion cost and extra earned income. Data modelling 1. Create a list of...
How would I test a code i made in FreeBSD? I created a dictionary called ls...
How would I test a code i made in FreeBSD? I created a dictionary called ls and inside of it i made a makefile and a code called ls.c; trying to recreate the ls -l command and want to test it.
How can SNOMED CT help in creating a data dictionary?
How can SNOMED CT help in creating a data dictionary?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT