A very long line: What data structure or structures would you use to maintain a very long queue of records, each having an id (some sort of string). You need to be able to find the first item in O(1) time, add to the end in O(1), and remove items in O(1) time, given some id (not index), from anywhere in the line. Additionally, you need to be able to find an item in line in O(1) time and see what items are near it (in front of or in back of) in O(1), possibly more (each is O(1) time). Explain what is stored in each Data Structure (“record (with id possibly)”, “pointers to ______”).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

A very long line: What data structure or structures would you use to maintain a very long queue of records, each having an id (some sort of string). You need to be able to find the first item in O(1) time, add to the end in O(1), and remove items in O(1) time, given some id (not index), from anywhere in the line. Additionally, you need to be able to find an item in line in O(1) time and see what items are near it (in front of or in back of) in O(1), possibly more (each is O(1) time). Explain what is stored in each Data Structure (“record (with id possibly)”, “pointers to ______”).

8. (15) Use Boyer-Moore to search the following text for the word AGCTCA.
k=
d₂(k)=
5
1
2
5
3 5
4
5
5
сл сл
5
Bad Symbol
A C G T U
5
1 4 2 6
AC GAT UA CACT AUC GAT C T U C A G CT CA
9. (20) A very long line: What data structure or structures would you use to maintain a very long queue
of records, each having an id (some sort of string). You need to be able to find the first item in 0(1)
time, add to the end in 0(1), and remove items in O(1) time, given some id (not index), from
anywhere in the line. Additionally, you need to be able to find an item in line in O(1) time and see
what items are near it (in front of or in back of) in O(1), possibly more (each is O(1) time). Explain
what is stored in each Data Structure ("record (with id possibly)","pointers to _").
Transcribed Image Text:8. (15) Use Boyer-Moore to search the following text for the word AGCTCA. k= d₂(k)= 5 1 2 5 3 5 4 5 5 сл сл 5 Bad Symbol A C G T U 5 1 4 2 6 AC GAT UA CACT AUC GAT C T U C A G CT CA 9. (20) A very long line: What data structure or structures would you use to maintain a very long queue of records, each having an id (some sort of string). You need to be able to find the first item in 0(1) time, add to the end in 0(1), and remove items in O(1) time, given some id (not index), from anywhere in the line. Additionally, you need to be able to find an item in line in O(1) time and see what items are near it (in front of or in back of) in O(1), possibly more (each is O(1) time). Explain what is stored in each Data Structure ("record (with id possibly)","pointers to _").
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Parallel and Distributed Storage
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education