From 7bd7f9a2839203ab22d75d869ff4107a40eced7c Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Fri, 25 May 2018 07:28:08 +0300 Subject: [PATCH] Add comments to data-structure complexity table. --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1422c692..d6757be8 100644 --- a/README.md +++ b/README.md @@ -199,17 +199,17 @@ Below is the list of some of the most used Big O notations and their performance ### Data Structure Operations Complexity -| Data Structure | Access | Search | Insertion | Deletion | -| ----------------------- | :-------: | :-------: | :-------: | :-------: | -| **Array** | 1 | n | n | n | -| **Stack** | n | n | 1 | 1 | -| **Queue** | n | n | 1 | 1 | -| **Linked List** | n | n | 1 | 1 | -| **Hash Table** | - | n | n | n | -| **Binary Search Tree** | n | n | n | n | -| **B-Tree** | log(n) | log(n) | log(n) | log(n) | -| **Red-Black Tree** | log(n) | log(n) | log(n) | log(n) | -| **AVL Tree** | log(n) | log(n) | log(n) | log(n) | +| Data Structure | Access | Search | Insertion | Deletion | Comments | +| ----------------------- | :-------: | :-------: | :-------: | :-------: | :-------- | +| **Array** | 1 | n | n | n | | +| **Stack** | n | n | 1 | 1 | | +| **Queue** | n | n | 1 | 1 | | +| **Linked List** | n | n | 1 | 1 | | +| **Hash Table** | - | n | n | n | In case of perfect hash function costs would be O(1) | +| **Binary Search Tree** | n | n | n | n | | +| **B-Tree** | log(n) | log(n) | log(n) | log(n) | | +| **Red-Black Tree** | log(n) | log(n) | log(n) | log(n) | | +| **AVL Tree** | log(n) | log(n) | log(n) | log(n) | | ### Array Sorting Algorithms Complexity