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

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...
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).
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.
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 can SNOMED CT help in creating a data dictionary?
How can SNOMED CT help in creating a data dictionary?
A simple random sample of 20 pages from a dictionary is obtained. The numbers of words...
A simple random sample of 20 pages from a dictionary is obtained. The numbers of words defined on those pages are found, with the results n=20, x=52.8 words, s=16.6 words. Given that this dictionary has 1439 pages with defined words, the claim that there are more than 70,000 defined words is equivalent to the claim that the mean number of words per page is greater than 48.6 words. Use a 0.01 significance level to test the claim that the mean...
A simple random sample of 10 pages from a dictionary is obtained. The numbers of words...
A simple random sample of 10 pages from a dictionary is obtained. The numbers of words defined on those pages are​ found, with the results n=10​, x overbarx=66.1 ​words, s=16.3 words. Given that this dictionary has 1454 pages with defined​ words, the claim that there are more than​ 70,000 defined words is equivalent to the claim that the mean number of words per page is greater than 48.1 words. Use a 0.10 significance level to test the claim that the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT