What is a 'Key' in computer science? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Origins of the term “distributed hash table”What is the meaning of this pseudo-code function?What is the definition of Computer Science, and what is the Science within Computer Science?What exactly is computer science?What is determinism in computer science?How do you express the theorem statement about unsuccessful search on average-case for unsuccessful searches in hashing with quantifiers?What Exactly Does the Term “Key” Mean with Regards to a Hash Table?Why must a Primary Index be sparse?What is standardization in computer science?How hash-table and hash-map are different?
What's parked in Mil Moscow helicopter plant?
When speaking, how do you change your mind mid-sentence?
How to translate "red flag" into Spanish?
What do you call an IPA symbol that lacks a name (e.g. ɲ)?
What is /etc/mtab in Linux?
Processing ADC conversion result: DMA vs Processor Registers
false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'
Suing a Police Officer Instead of the Police Department
Simulate round-robin tournament draw
How do I deal with an erroneously large refund?
How long can a nation maintain a technological edge over the rest of the world?
Why isn't everyone flabbergasted about Bran's "gift"?
In search of the origins of term censor, I hit a dead end stuck with the greek term, to censor, λογοκρίνω
Where to find documentation for `whois` command options?
Are there existing rules/lore for MTG planeswalkers?
Is a self contained air-bullet cartridge feasible?
SQL Server placement of master database files vs resource database files
Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table
Marquee sign letters
What is the ongoing value of the Kanban board to the developers as opposed to management
What does the black goddess statue do and what is it?
How to compute a Jacobian using polar coordinates?
Has a Nobel Peace laureate ever been accused of war crimes?
Why aren't road bicycle wheels tiny?
What is a 'Key' in computer science?
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Origins of the term “distributed hash table”What is the meaning of this pseudo-code function?What is the definition of Computer Science, and what is the Science within Computer Science?What exactly is computer science?What is determinism in computer science?How do you express the theorem statement about unsuccessful search on average-case for unsuccessful searches in hashing with quantifiers?What Exactly Does the Term “Key” Mean with Regards to a Hash Table?Why must a Primary Index be sparse?What is standardization in computer science?How hash-table and hash-map are different?
$begingroup$
I'm a bit confused on what exactly the meaning of a 'key' is in computer science. I understand key-value pairs, primary keys, etc... But I can't find a definition of what the term 'key' means by itself.
As far as I can tell it just means a piece of data. In CLRS, data associated with tree nodes are referred to as 'keys'. Data to search a hash table is called a 'key'. Is this what a 'key' is?
terminology
New contributor
$endgroup$
add a comment |
$begingroup$
I'm a bit confused on what exactly the meaning of a 'key' is in computer science. I understand key-value pairs, primary keys, etc... But I can't find a definition of what the term 'key' means by itself.
As far as I can tell it just means a piece of data. In CLRS, data associated with tree nodes are referred to as 'keys'. Data to search a hash table is called a 'key'. Is this what a 'key' is?
terminology
New contributor
$endgroup$
4
$begingroup$
There is not one specific technical definition. The use of the word is usually inspired by its normal, English definition, e.g. merriam-webster.com/dictionary/key Or rather I should say "definitions". In general, your expectation should be that there isn't a unifying technical definition for common English words that are used in multiple contexts even within a single field of study.
$endgroup$
– Derek Elkins
3 hours ago
1
$begingroup$
Generally, a key is a term that's often used to refer to some value that can be used to uniquely identify something else. However, a lot depends on the context in which the term is used (e.g. tree data structure vs cryptography).
$endgroup$
– code_dredd
2 hours ago
$begingroup$
To expand a little on @code_dredd 's comment, I'd say that a key is most generally an index of some sort into a set of data. Provided a key, one can retrieve the associated data from the set. In cryptography though, the "key" is the secret needed to decrypt or encrypt data. That's the analogy to a "key" locking, or unlocking a door. One sense is a "reference key" (like you'd have on a map) while the other is more like a physical key which grants or denies access via a lock.
$endgroup$
– JesseM
1 hour ago
$begingroup$
Guys, don't answer in comments. We have answers for answers.
$endgroup$
– Lightness Races in Orbit
55 mins ago
add a comment |
$begingroup$
I'm a bit confused on what exactly the meaning of a 'key' is in computer science. I understand key-value pairs, primary keys, etc... But I can't find a definition of what the term 'key' means by itself.
As far as I can tell it just means a piece of data. In CLRS, data associated with tree nodes are referred to as 'keys'. Data to search a hash table is called a 'key'. Is this what a 'key' is?
terminology
New contributor
$endgroup$
I'm a bit confused on what exactly the meaning of a 'key' is in computer science. I understand key-value pairs, primary keys, etc... But I can't find a definition of what the term 'key' means by itself.
As far as I can tell it just means a piece of data. In CLRS, data associated with tree nodes are referred to as 'keys'. Data to search a hash table is called a 'key'. Is this what a 'key' is?
terminology
terminology
New contributor
New contributor
New contributor
asked 6 hours ago
TheMaxTheMax
363
363
New contributor
New contributor
4
$begingroup$
There is not one specific technical definition. The use of the word is usually inspired by its normal, English definition, e.g. merriam-webster.com/dictionary/key Or rather I should say "definitions". In general, your expectation should be that there isn't a unifying technical definition for common English words that are used in multiple contexts even within a single field of study.
$endgroup$
– Derek Elkins
3 hours ago
1
$begingroup$
Generally, a key is a term that's often used to refer to some value that can be used to uniquely identify something else. However, a lot depends on the context in which the term is used (e.g. tree data structure vs cryptography).
$endgroup$
– code_dredd
2 hours ago
$begingroup$
To expand a little on @code_dredd 's comment, I'd say that a key is most generally an index of some sort into a set of data. Provided a key, one can retrieve the associated data from the set. In cryptography though, the "key" is the secret needed to decrypt or encrypt data. That's the analogy to a "key" locking, or unlocking a door. One sense is a "reference key" (like you'd have on a map) while the other is more like a physical key which grants or denies access via a lock.
$endgroup$
– JesseM
1 hour ago
$begingroup$
Guys, don't answer in comments. We have answers for answers.
$endgroup$
– Lightness Races in Orbit
55 mins ago
add a comment |
4
$begingroup$
There is not one specific technical definition. The use of the word is usually inspired by its normal, English definition, e.g. merriam-webster.com/dictionary/key Or rather I should say "definitions". In general, your expectation should be that there isn't a unifying technical definition for common English words that are used in multiple contexts even within a single field of study.
$endgroup$
– Derek Elkins
3 hours ago
1
$begingroup$
Generally, a key is a term that's often used to refer to some value that can be used to uniquely identify something else. However, a lot depends on the context in which the term is used (e.g. tree data structure vs cryptography).
$endgroup$
– code_dredd
2 hours ago
$begingroup$
To expand a little on @code_dredd 's comment, I'd say that a key is most generally an index of some sort into a set of data. Provided a key, one can retrieve the associated data from the set. In cryptography though, the "key" is the secret needed to decrypt or encrypt data. That's the analogy to a "key" locking, or unlocking a door. One sense is a "reference key" (like you'd have on a map) while the other is more like a physical key which grants or denies access via a lock.
$endgroup$
– JesseM
1 hour ago
$begingroup$
Guys, don't answer in comments. We have answers for answers.
$endgroup$
– Lightness Races in Orbit
55 mins ago
4
4
$begingroup$
There is not one specific technical definition. The use of the word is usually inspired by its normal, English definition, e.g. merriam-webster.com/dictionary/key Or rather I should say "definitions". In general, your expectation should be that there isn't a unifying technical definition for common English words that are used in multiple contexts even within a single field of study.
$endgroup$
– Derek Elkins
3 hours ago
$begingroup$
There is not one specific technical definition. The use of the word is usually inspired by its normal, English definition, e.g. merriam-webster.com/dictionary/key Or rather I should say "definitions". In general, your expectation should be that there isn't a unifying technical definition for common English words that are used in multiple contexts even within a single field of study.
$endgroup$
– Derek Elkins
3 hours ago
1
1
$begingroup$
Generally, a key is a term that's often used to refer to some value that can be used to uniquely identify something else. However, a lot depends on the context in which the term is used (e.g. tree data structure vs cryptography).
$endgroup$
– code_dredd
2 hours ago
$begingroup$
Generally, a key is a term that's often used to refer to some value that can be used to uniquely identify something else. However, a lot depends on the context in which the term is used (e.g. tree data structure vs cryptography).
$endgroup$
– code_dredd
2 hours ago
$begingroup$
To expand a little on @code_dredd 's comment, I'd say that a key is most generally an index of some sort into a set of data. Provided a key, one can retrieve the associated data from the set. In cryptography though, the "key" is the secret needed to decrypt or encrypt data. That's the analogy to a "key" locking, or unlocking a door. One sense is a "reference key" (like you'd have on a map) while the other is more like a physical key which grants or denies access via a lock.
$endgroup$
– JesseM
1 hour ago
$begingroup$
To expand a little on @code_dredd 's comment, I'd say that a key is most generally an index of some sort into a set of data. Provided a key, one can retrieve the associated data from the set. In cryptography though, the "key" is the secret needed to decrypt or encrypt data. That's the analogy to a "key" locking, or unlocking a door. One sense is a "reference key" (like you'd have on a map) while the other is more like a physical key which grants or denies access via a lock.
$endgroup$
– JesseM
1 hour ago
$begingroup$
Guys, don't answer in comments. We have answers for answers.
$endgroup$
– Lightness Races in Orbit
55 mins ago
$begingroup$
Guys, don't answer in comments. We have answers for answers.
$endgroup$
– Lightness Races in Orbit
55 mins ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
In the most general sense, a key is a piece of information required to retrieve some data. However, this meaning plays out differently depending on exactly what situation you're dealing with.
In the contexts you mention, a key is a unique identifier for the complete data used to retrieve it from some location in the structure. Each key is associated with only one item, so it can be used to find a particular set of data. The data structure will usually be organized in such a way that finding the key is much more efficient than a linear search through all of the data. Sometimes the key is actually part of the data and stored along with it (like primary keys in the database); other times, it is segregated from the data itself (like in a hash map). The data structure will also often perform extra processing on the key (and only the key) to support its efficient searching algorithm (such as in a hash map, the key is converted into a hash code, or a database will index the primary keys using a B-tree).
In cryptography, a key is used in a sense more akin to physical keys used on locks. They're pieces of data required to obtain the original from the encrypted data (to "unlock" the data, so to speak).
New contributor
$endgroup$
2
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
add a comment |
$begingroup$
A key in the context of data structures (such as in the book CLRS) is a value (often an integer) that is used to identify a certain component of a data-structure. Often, keys determine how the underlying data is stored or manipulated. For example, in binary search trees we have that for every node, the key of that node is larger than the keys in the left sub-tree and smaller than those in the right subtree. This property makes it easier to search for a given key (or determine there is no node with such a key).
In practice, our 'actual' data is often not a key, but something larger and more relevant that a single number. This data is called satellite data and can be mostly ignored when dealing with manipulations on data structures, as long as the satellite data moves whenever the key gets moved (otherwise, you lose track of your data).
The concept of a key is similar in the context of databases, but there it is often required that a key is unique. A primary key has to be unique, for example. This requirement is often nessecary in the context of data-structures, but is sometimes made for simplicity.
In cryptography, a key usually refers to an (often secret, but not always!) parameter that is needed to encrypt or decrypt with a given en- or decryption algorithm. The keys used to encrypt and decrypt have to be 'related' (in symmetric cryptography, the need to be the same) for the process to encryption or decryption to be successful.
$endgroup$
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
1
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "419"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
TheMax is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f107439%2fwhat-is-a-key-in-computer-science%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
In the most general sense, a key is a piece of information required to retrieve some data. However, this meaning plays out differently depending on exactly what situation you're dealing with.
In the contexts you mention, a key is a unique identifier for the complete data used to retrieve it from some location in the structure. Each key is associated with only one item, so it can be used to find a particular set of data. The data structure will usually be organized in such a way that finding the key is much more efficient than a linear search through all of the data. Sometimes the key is actually part of the data and stored along with it (like primary keys in the database); other times, it is segregated from the data itself (like in a hash map). The data structure will also often perform extra processing on the key (and only the key) to support its efficient searching algorithm (such as in a hash map, the key is converted into a hash code, or a database will index the primary keys using a B-tree).
In cryptography, a key is used in a sense more akin to physical keys used on locks. They're pieces of data required to obtain the original from the encrypted data (to "unlock" the data, so to speak).
New contributor
$endgroup$
2
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
add a comment |
$begingroup$
In the most general sense, a key is a piece of information required to retrieve some data. However, this meaning plays out differently depending on exactly what situation you're dealing with.
In the contexts you mention, a key is a unique identifier for the complete data used to retrieve it from some location in the structure. Each key is associated with only one item, so it can be used to find a particular set of data. The data structure will usually be organized in such a way that finding the key is much more efficient than a linear search through all of the data. Sometimes the key is actually part of the data and stored along with it (like primary keys in the database); other times, it is segregated from the data itself (like in a hash map). The data structure will also often perform extra processing on the key (and only the key) to support its efficient searching algorithm (such as in a hash map, the key is converted into a hash code, or a database will index the primary keys using a B-tree).
In cryptography, a key is used in a sense more akin to physical keys used on locks. They're pieces of data required to obtain the original from the encrypted data (to "unlock" the data, so to speak).
New contributor
$endgroup$
2
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
add a comment |
$begingroup$
In the most general sense, a key is a piece of information required to retrieve some data. However, this meaning plays out differently depending on exactly what situation you're dealing with.
In the contexts you mention, a key is a unique identifier for the complete data used to retrieve it from some location in the structure. Each key is associated with only one item, so it can be used to find a particular set of data. The data structure will usually be organized in such a way that finding the key is much more efficient than a linear search through all of the data. Sometimes the key is actually part of the data and stored along with it (like primary keys in the database); other times, it is segregated from the data itself (like in a hash map). The data structure will also often perform extra processing on the key (and only the key) to support its efficient searching algorithm (such as in a hash map, the key is converted into a hash code, or a database will index the primary keys using a B-tree).
In cryptography, a key is used in a sense more akin to physical keys used on locks. They're pieces of data required to obtain the original from the encrypted data (to "unlock" the data, so to speak).
New contributor
$endgroup$
In the most general sense, a key is a piece of information required to retrieve some data. However, this meaning plays out differently depending on exactly what situation you're dealing with.
In the contexts you mention, a key is a unique identifier for the complete data used to retrieve it from some location in the structure. Each key is associated with only one item, so it can be used to find a particular set of data. The data structure will usually be organized in such a way that finding the key is much more efficient than a linear search through all of the data. Sometimes the key is actually part of the data and stored along with it (like primary keys in the database); other times, it is segregated from the data itself (like in a hash map). The data structure will also often perform extra processing on the key (and only the key) to support its efficient searching algorithm (such as in a hash map, the key is converted into a hash code, or a database will index the primary keys using a B-tree).
In cryptography, a key is used in a sense more akin to physical keys used on locks. They're pieces of data required to obtain the original from the encrypted data (to "unlock" the data, so to speak).
New contributor
New contributor
answered 4 hours ago
jpmc26jpmc26
20814
20814
New contributor
New contributor
2
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
add a comment |
2
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
2
2
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
To prevent possible confusion: in the book CLRS, keys are usually not considered to be unique, as they don't have to be for many data structures.
$endgroup$
– Discrete lizard♦
3 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
Then, in general, a key is data to navigate a data structure? That makes sense to me, like a physical key is used to retrieve something from a locked box.
$endgroup$
– TheMax
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
$begingroup$
@TheMax I would not say that definition suits cryptography, as there's no "navigation" to be done. It does suit your list of examples, but I don't see it as a parallel to a physical key in those cases.
$endgroup$
– jpmc26
2 hours ago
add a comment |
$begingroup$
A key in the context of data structures (such as in the book CLRS) is a value (often an integer) that is used to identify a certain component of a data-structure. Often, keys determine how the underlying data is stored or manipulated. For example, in binary search trees we have that for every node, the key of that node is larger than the keys in the left sub-tree and smaller than those in the right subtree. This property makes it easier to search for a given key (or determine there is no node with such a key).
In practice, our 'actual' data is often not a key, but something larger and more relevant that a single number. This data is called satellite data and can be mostly ignored when dealing with manipulations on data structures, as long as the satellite data moves whenever the key gets moved (otherwise, you lose track of your data).
The concept of a key is similar in the context of databases, but there it is often required that a key is unique. A primary key has to be unique, for example. This requirement is often nessecary in the context of data-structures, but is sometimes made for simplicity.
In cryptography, a key usually refers to an (often secret, but not always!) parameter that is needed to encrypt or decrypt with a given en- or decryption algorithm. The keys used to encrypt and decrypt have to be 'related' (in symmetric cryptography, the need to be the same) for the process to encryption or decryption to be successful.
$endgroup$
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
1
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
add a comment |
$begingroup$
A key in the context of data structures (such as in the book CLRS) is a value (often an integer) that is used to identify a certain component of a data-structure. Often, keys determine how the underlying data is stored or manipulated. For example, in binary search trees we have that for every node, the key of that node is larger than the keys in the left sub-tree and smaller than those in the right subtree. This property makes it easier to search for a given key (or determine there is no node with such a key).
In practice, our 'actual' data is often not a key, but something larger and more relevant that a single number. This data is called satellite data and can be mostly ignored when dealing with manipulations on data structures, as long as the satellite data moves whenever the key gets moved (otherwise, you lose track of your data).
The concept of a key is similar in the context of databases, but there it is often required that a key is unique. A primary key has to be unique, for example. This requirement is often nessecary in the context of data-structures, but is sometimes made for simplicity.
In cryptography, a key usually refers to an (often secret, but not always!) parameter that is needed to encrypt or decrypt with a given en- or decryption algorithm. The keys used to encrypt and decrypt have to be 'related' (in symmetric cryptography, the need to be the same) for the process to encryption or decryption to be successful.
$endgroup$
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
1
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
add a comment |
$begingroup$
A key in the context of data structures (such as in the book CLRS) is a value (often an integer) that is used to identify a certain component of a data-structure. Often, keys determine how the underlying data is stored or manipulated. For example, in binary search trees we have that for every node, the key of that node is larger than the keys in the left sub-tree and smaller than those in the right subtree. This property makes it easier to search for a given key (or determine there is no node with such a key).
In practice, our 'actual' data is often not a key, but something larger and more relevant that a single number. This data is called satellite data and can be mostly ignored when dealing with manipulations on data structures, as long as the satellite data moves whenever the key gets moved (otherwise, you lose track of your data).
The concept of a key is similar in the context of databases, but there it is often required that a key is unique. A primary key has to be unique, for example. This requirement is often nessecary in the context of data-structures, but is sometimes made for simplicity.
In cryptography, a key usually refers to an (often secret, but not always!) parameter that is needed to encrypt or decrypt with a given en- or decryption algorithm. The keys used to encrypt and decrypt have to be 'related' (in symmetric cryptography, the need to be the same) for the process to encryption or decryption to be successful.
$endgroup$
A key in the context of data structures (such as in the book CLRS) is a value (often an integer) that is used to identify a certain component of a data-structure. Often, keys determine how the underlying data is stored or manipulated. For example, in binary search trees we have that for every node, the key of that node is larger than the keys in the left sub-tree and smaller than those in the right subtree. This property makes it easier to search for a given key (or determine there is no node with such a key).
In practice, our 'actual' data is often not a key, but something larger and more relevant that a single number. This data is called satellite data and can be mostly ignored when dealing with manipulations on data structures, as long as the satellite data moves whenever the key gets moved (otherwise, you lose track of your data).
The concept of a key is similar in the context of databases, but there it is often required that a key is unique. A primary key has to be unique, for example. This requirement is often nessecary in the context of data-structures, but is sometimes made for simplicity.
In cryptography, a key usually refers to an (often secret, but not always!) parameter that is needed to encrypt or decrypt with a given en- or decryption algorithm. The keys used to encrypt and decrypt have to be 'related' (in symmetric cryptography, the need to be the same) for the process to encryption or decryption to be successful.
edited 3 hours ago
answered 5 hours ago
Discrete lizard♦Discrete lizard
4,73311538
4,73311538
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
1
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
add a comment |
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
1
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
And in cryptography?
$endgroup$
– jpmc26
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
What is the difference between satellite data and keys then? From what I understand, satellite data is data organized by the data structure that is not part of the actual structure. So can I say a keys and satellite data are both data in the structure, but keys are part of the structure and satellite data is not?
$endgroup$
– TheMax
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard♦
4 hours ago
1
1
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
$begingroup$
@TheMax In a way, yes. The precise content of the satellite data is irrelevant for the operations on the data-structure (but likely relevant for the application using the data structure). This decoupling of key and data makes it easier for to design efficient data-structures.
$endgroup$
– Discrete lizard♦
4 hours ago
add a comment |
TheMax is a new contributor. Be nice, and check out our Code of Conduct.
TheMax is a new contributor. Be nice, and check out our Code of Conduct.
TheMax is a new contributor. Be nice, and check out our Code of Conduct.
TheMax is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Computer Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f107439%2fwhat-is-a-key-in-computer-science%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
$begingroup$
There is not one specific technical definition. The use of the word is usually inspired by its normal, English definition, e.g. merriam-webster.com/dictionary/key Or rather I should say "definitions". In general, your expectation should be that there isn't a unifying technical definition for common English words that are used in multiple contexts even within a single field of study.
$endgroup$
– Derek Elkins
3 hours ago
1
$begingroup$
Generally, a key is a term that's often used to refer to some value that can be used to uniquely identify something else. However, a lot depends on the context in which the term is used (e.g. tree data structure vs cryptography).
$endgroup$
– code_dredd
2 hours ago
$begingroup$
To expand a little on @code_dredd 's comment, I'd say that a key is most generally an index of some sort into a set of data. Provided a key, one can retrieve the associated data from the set. In cryptography though, the "key" is the secret needed to decrypt or encrypt data. That's the analogy to a "key" locking, or unlocking a door. One sense is a "reference key" (like you'd have on a map) while the other is more like a physical key which grants or denies access via a lock.
$endgroup$
– JesseM
1 hour ago
$begingroup$
Guys, don't answer in comments. We have answers for answers.
$endgroup$
– Lightness Races in Orbit
55 mins ago