What is a 'Key' in computer science? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm 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?

Was Objective-C really a hinderance to Apple software development?

/bin/ls sorts differently than just ls

Why did Israel vote against lifting the American embargo on Cuba?

What *exactly* is electrical current, voltage, and resistance?

Determinant of a matrix with 2 equal rows

What is the definining line between a helicopter and a drone a person can ride in?

Why isn't everyone flabbergasted about Bran's "gift"?

What do you call an IPA symbol that lacks a name (e.g. ɲ)?

Can gravitational waves pass through a black hole?

Is it accepted to use working hours to read general interest books?

TV series episode where humans nuke aliens before decrypting their message that states they come in peace

Cisco DHCP Router

What is the ongoing value of the Kanban board to the developers as opposed to management

All ASCII characters with a given bit count

Marquee sign letters

Co-worker works way more than he should

Not within Jobscope - Aggravated injury

When I export an AI 300x60 art board it saves with bigger dimensions

Can't solve system of linear equations (that need simplification first)

The 'gros' functor from schemes into (strictly) locally ringed topoi

Tikz - create rectangle with same width as the picture

Writing a t-sql stored procedure to recieve 4 numbers and insert them into a table

Is a self contained air-bullet cartridge feasible?

What helicopter has the most rotor blades?



What is a 'Key' in computer science?



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm 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?










3












$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?










share|cite|improve this question







New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$







  • 1




    $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
    35 mins ago















3












$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?










share|cite|improve this question







New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$







  • 1




    $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
    35 mins ago













3












3








3


1



$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?










share|cite|improve this question







New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$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






share|cite|improve this question







New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|cite|improve this question







New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|cite|improve this question




share|cite|improve this question






New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









TheMaxTheMax

192




192




New contributor




TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






TheMax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    $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
    35 mins ago












  • 1




    $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
    35 mins ago







1




1




$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
35 mins 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
35 mins ago










2 Answers
2






active

oldest

votes


















6












$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.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    And in cryptography?
    $endgroup$
    – jpmc26
    1 hour 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
    1 hour ago










  • $begingroup$
    @jpmc26 Added, thanks for mentioning it.
    $endgroup$
    – Discrete lizard
    1 hour 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
    1 hour ago


















3












$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).






share|cite|improve this answer








New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$








  • 1




    $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
    35 mins ago











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.









draft saved

draft discarded


















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









6












$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.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    And in cryptography?
    $endgroup$
    – jpmc26
    1 hour 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
    1 hour ago










  • $begingroup$
    @jpmc26 Added, thanks for mentioning it.
    $endgroup$
    – Discrete lizard
    1 hour 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
    1 hour ago















6












$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.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    And in cryptography?
    $endgroup$
    – jpmc26
    1 hour 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
    1 hour ago










  • $begingroup$
    @jpmc26 Added, thanks for mentioning it.
    $endgroup$
    – Discrete lizard
    1 hour 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
    1 hour ago













6












6








6





$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.






share|cite|improve this answer











$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.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited 34 mins ago

























answered 2 hours ago









Discrete lizardDiscrete lizard

4,69311538




4,69311538











  • $begingroup$
    And in cryptography?
    $endgroup$
    – jpmc26
    1 hour 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
    1 hour ago










  • $begingroup$
    @jpmc26 Added, thanks for mentioning it.
    $endgroup$
    – Discrete lizard
    1 hour 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
    1 hour ago
















  • $begingroup$
    And in cryptography?
    $endgroup$
    – jpmc26
    1 hour 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
    1 hour ago










  • $begingroup$
    @jpmc26 Added, thanks for mentioning it.
    $endgroup$
    – Discrete lizard
    1 hour 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
    1 hour ago















$begingroup$
And in cryptography?
$endgroup$
– jpmc26
1 hour ago




$begingroup$
And in cryptography?
$endgroup$
– jpmc26
1 hour 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
1 hour 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
1 hour ago












$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard
1 hour ago




$begingroup$
@jpmc26 Added, thanks for mentioning it.
$endgroup$
– Discrete lizard
1 hour 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
1 hour 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
1 hour ago











3












$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).






share|cite|improve this answer








New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$








  • 1




    $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
    35 mins ago















3












$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).






share|cite|improve this answer








New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$








  • 1




    $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
    35 mins ago













3












3








3





$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).






share|cite|improve this answer








New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$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).







share|cite|improve this answer








New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|cite|improve this answer



share|cite|improve this answer






New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 59 mins ago









jpmc26jpmc26

1334




1334




New contributor




jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






jpmc26 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    $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
    35 mins ago












  • 1




    $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
    35 mins ago







1




1




$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
35 mins 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
35 mins ago










TheMax is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Bett Inhaltsverzeichnis Geschichte | Bettformen | Bettgrößen | Andere Bezeichnungen | Bettenmangel | Betten in der bildenden Kunst | Schlafmedizinische Gesichtspunkte | Siehe auch | Literatur | Weblinks | Einzelnachweise | NavigationsmenüBett, Bettstatt, BettstelleCommons: BettBabybetten: Anwendung, Ausstattungsmerkmale und VergleichskriterienWasserbetten. Vorurteile im TestHapfnNursch10.1007/s11818-012-0584-74006250-8AKS4329276-8

Luksemburg Sisukord Nimi | Asend | Loodus | Riigikord | Haldusjaotus | Rahvastik | Riigikaitse | Majandus | Taristu | Ajalugu | Eesti ja Luksemburgi suhted | Haridus | Kultuur | Vaata ka | Viited | Välislingid | Navigeerimismenüü50° N, 6° EÜlevaade Luksemburgi kaitsealadest.Luksemburgi rahvaarv. Statistikaamet.World Bank'i andmebaasÜlevaade Luksemburgi loodusest.Ülevaade Luksemburgi metsadest.Guy Colling. "Red List of the Vascular Plants of Luxembourg." Travaux scientifiques du Musée national d’histoire naturelle Luxembourg. 2005.Luxembourg’s biodiversity at risk.Maailma kahepaiksete andmebaas.Denis Lepage. "Luxembourg." Avibase.Ülevaade temperatuuridest. Luksemburgi meteoroloogiateenistus.Ülevaade Luksemburgist. Euroopa Liidu esinduse koduleht.Système politique. TerritoireÜlevaade Luksemburgi rahvastikust. Luksemburgi statistikaamet.Luksemburgi rahvastik. Luksemburgi statistikaamet.The World FactbookMonique Borsenberger, Paul Dickes. "Religions au Luxembourg. Quelle évolution entre 1999-2008". Luksemburgi statistikaamet. 2011.Luksemburgi peapiiskopkond. Catholic-Hierarchy.Luksemburgi armee koduleht.Luksemburgi armee relvastus.Eesti Välisministeerium.Luksemburgi rahvastik. Luksemburgi statistikaamet.Luksemburgi Eesti Seltsi koduleht.Helen Eelrand. "Raadio, mis muutis maailma." Eesti Päevaleht. 13. märts 2004.Ülevaade Luksemburgi haridussüsteemist.Ülevaade Luksemburgi keskkoolidest.Luksemburgr

Valle di Casies Indice Geografia fisica | Origini del nome | Storia | Società | Amministrazione | Sport | Note | Bibliografia | Voci correlate | Altri progetti | Collegamenti esterni | Menu di navigazione46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)Sito istituzionaleAstat Censimento della popolazione 2011 - Determinazione della consistenza dei tre gruppi linguistici della Provincia Autonoma di Bolzano-Alto Adige - giugno 2012Numeri e fattiValle di CasiesDato IstatTabella dei gradi/giorno dei Comuni italiani raggruppati per Regione e Provincia26 agosto 1993, n. 412Heraldry of the World: GsiesStatistiche I.StatValCasies.comWikimedia CommonsWikimedia CommonsValle di CasiesSito ufficialeValle di CasiesMM14870458910042978-6