Cheatography
https://cheatography.com
this is a trial cheat sheet.
Data Structure
Data Structures are an important part of any language, let's look at a few of the basic data structures : |
Arrays |
Linked Lists |
Stacks and Queues |
Note : This is not a comprehensive list of data structures, just a small part of them
Stacks and Queues
The stack and the queue are data types that support insertion and deletion operations with well-defined semantics. Stack deletion deletes the element in the stack that was inserted the last, while a queue deletion deletes the element in the queue that was inserted the earliest. For this reason, the stack is often referred to as a LIFO (Last In First Out) data type and the queue as an FIFO (First In First out) data type. |
|
|
Arrays
Arrays are <index,value> pairs that can be used to store information and easy retrieval of said information. |
An array used to store a list of values in no particular order is known as an unsorted list. |
An array where the order of the list of values is important is known as a sorted list. |
Linked List
The linked list is an alternative to the array when a collection of objects is to be stored. The linked list is implemented using pointers. Thus, an element (or node) of a linked list contains the actual data to be stored and a pointer to the next node. Pointer is simply the address in memory of the next node.Thus,a key difference from arrays is that a linked list does not have to be stored contiguously in memory. |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets