Show Menu
Cheatography

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 compre­hensive list of data struct­ures, 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-d­efined 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 <in­dex­,va­lue> pairs that can be used to store inform­ation and easy retrieval of said inform­ation.
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 altern­ative to the array when a collection of objects is to be stored. The linked list is implem­ented 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.T­hus,a key difference from arrays is that a linked list does not have to be stored contig­uously in memory.
       
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          C Reference Cheat Sheet