Skip to main content

All you need is RIGHT Data Structures at RIGHT implementation.

So, lets erase the confusion of what, which, when the data structure to be used through this article.
As part of academic we are well known that, data structures are classified into Linear and Non-Linear Data Structures.

Linear are the Data Structures like Array, Sorted Array, Stack, Queue, Linked List.
Non-Linear are the Data Structures Like Binary Tree, Red-Black Tree, 2-3-4 Tree, Graph, Hash Table, Heap

Array:
Advantages:
1. Quick Insertion
2. Quick Access of any element in the array
Disadvantages:
1. Slow Deletion
2. Slow Search

Sorted Array:
Advantages:
1. Quick Search
2. Quick Access of any element
Disadvantages:
1. Slow Deletion, Insertion

Stack:
Advantages:
1. Last In First Out access
Disadvantages:
1. Slow Access, Search for remaining elements

Queue:
Advantages:
1. First In First Out Access
Disadvantages:
1. Slow Access, Search for other elements

Linked List:
Advantages:
1. Quick Insertion, Deletion
Disadvantages:
1. Slow Search

Binary Tree:
Advantages:
1. Quick Search, Insertion, Deletion ( If the Tree is BALANCED )
Disadvantages:
1. Deletion Algorithm is complex

Red-Black Tree:
Advantages:
1. Quick Search, Insertion, Deletion ( Tree is ALWAYS BALANCED )
Disadvantages:
1. Complex

2-3-4 Tree:
Advantages:
1. Quick Search, Insertion, Deletion ( Tree is ALWAYS BALANCED )
2. Good for Disk Storage
Disadvantages:
1. Complex

Hash Table:
Advantages:
1. Fast Access if the key is known
2. Fast Insertion
Disadvantages:
1. Slow Access, Insertion

Heap:
Advantages:
1. Fast Insertion, Deletion
2. Fast Access to the largest item
Disadvantages:
1. Slow Access to the remaining items

Comments

Popular posts from this blog

Sexy C#

Download samples   Table of Contents   1.   Introduction  2.   Background    3.   Sexy Features 3.1.   Extension Methods   3.2.   Anonymous Type   3.3.   Delegate   3.4.   Lambda Expression 3.5.   Async-Await Pair   3.6.   Generics   4.   Conclusion   1. Introduction     C#  is a very popular programming language. It is mostly popular in the .NET arena. The main reason behind that is the C# language contains so many useful features. It is actually a multi-paradigm programming language. Q.   Why do we call C# a muti-paradigm programming language? A.  Well, C# has the following characteristics:  Strongly typed   Object Oriented  Functional  Declarative Programming  Imperative Programming   Component based Programming Dynamic Programming ...

Kubernetes – init containers, CNI and more

Certain questions about Kubernetes seem to come up again and again: What’s up with this init container stuff? What’s a CNI plugin? Why is Kubernetes complaining about pods not finishing initialisation? Kubernetes is a complex system with a simple overall purpose: run user  workloads  in a way that permits the authors of the workloads to not care (much) about the messy details of the hardware underneath. The workload authors are supposed to be able to just focus on Pods and Services; in turn, Kubernetes is meant to arrange things such that workloads get mapped to Pods, Pods get deployed on Nodes, and the network in between looks flat and transparent. This is simple to state, but  extremely  complex to implement in practice. (This is an area where Kubernetes is doing a great job of making things complex for the Kubernetes implementors so that they can be easier for the users – nicely done!) Under the hood, Kubernetes is leaning heavily on a number of technologies to ma...

What happens from Keyboard to Kernel ?

Brief introduction to Linux kernel and shell Users new to Linux will want to familiarise themselves with the following: terminal  is a program that opens a window and lets you interact with the shell shell  is a program that takes commands from the keyboard and gives them to the operating system to perform. Bourne-Again shell, usually referred to as bash, which is the default shell for most Linux distributions. When you first login to a server, you will be dropped into the command prompt, or shell prompt, which is where you can issue commands to the server. The shell will forward its input (usually, from your own key presses) to the running program’s stdin, and it will forward the program’s output (stdout and stderr) to its own output (usually displayed on your screen). The shell is an interface that translates commands into some low-level calls to the kernel. kernel  is the essential center of a computer operating system, the core that provides basic services f...