Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ds2-notes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
datovky
ds2-notes
Commits
951f4821
Commit
951f4821
authored
6 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Preliminaries: Technically speaking, hash tables support order operations
parent
1e80e26d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
01-prelim/prelim.tex
+3
-1
3 additions, 1 deletion
01-prelim/prelim.tex
with
3 additions
and
1 deletion
01-prelim/prelim.tex
+
3
−
1
View file @
951f4821
...
...
@@ -112,7 +112,8 @@ $\opdf{Succ}(x)$ & Return the successor of $x\in{\cal U}$ --- the smallest
$
\opdf
{
Pred
}
(
x
)
$
&
Similarly, the predecessor of~
$
x
$
is the largest element
smaller than~
$
x
$
.
\cr
}
Except for hash tables, all our implementations of sets can support order operations:
All our implementations of sets can support order operations,
but their time complexity varies:
$$
\vbox
{
\halign
{
#
\hfil\qquad
&&
$#$
\hfil
~~
\cr
&
\alg
{
Min
}
/
\alg
{
Max
}
&
\alg
{
Pred
}
/
\alg
{
Succ
}
\cr
...
...
@@ -121,6 +122,7 @@ Linked list & \O(n) & \O(n) \cr
Array
&
\O
(
n
)
&
\O
(
n
)
\cr
Sorted array
&
\O
(
1
)
&
\O
(
\log
n
)
\cr
Binary search tree
&
\O
(
\log
n
)
&
\O
(
\log
n
)
\cr
Hash table
&
\O
(
n
)
&
\O
(
n
)
\cr
}}$$
A~sequence can be sorted by
$
n
$
~calls to
\alg
{
Insert
}
, one
\alg
{
Min
}
, and
$
n
$
~calls to
\alg
{
Succ
}
.
If the elements can be only compared, the standard lower bound for comparison-based sorting
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment