Skip to content

Commit

Permalink
End with BigONotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkady-Skvortsov committed May 14, 2022
1 parent b712924 commit 6650cea
Show file tree
Hide file tree
Showing 79 changed files with 2,609 additions and 1,212 deletions.
2 changes: 1 addition & 1 deletion BIG-O-NOTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Time complexity - https://en.wikipedia.org/wiki/Time_complexity
//O(2^5) = 32
```

# O(n!) -
# O(n!) - Factorial time

```ts
//O(5!) = 120
Expand Down
23 changes: 5 additions & 18 deletions DATA-STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,31 @@ Wikipedia - https://en.wikipedia.org/wiki/Data_structure<br />

Stacks are known as LIFO (Last In First Out) structures. This means the element placed last can be accessed first. You can “push” a new element onto the top of the stack, or you can “pop,” deleting the element inserted last which is at the top of the stack.<br />

Where is using: ;

Wikipedia: https://en.wikipedia.org/wiki/Stack<br />

<p style="text-align: center"><img width="400" src="./assets/data-structure/stack.jpg" /></p>

# Queue

A queue functions similarly to a stack, but instead of being a LIFO structure, it is a FIFO (First In First Out) structure. The easiest way to think about a queue is to think of a line of people waiting to enter a building. The person at the beginning of the line will enter the building first, while the person at the end will enter last.

You can enqueue an element in this structure, which means inserting the element to the end of the queue. You can also dequeue an element, which means deleting an element from the beginning of the queue.

Queues are often used to manage threads in multithreading, and they are (not surprisingly) used to implement priority queuing systems.<br />
A queue functions similarly to a stack, but instead of being a LIFO structure, it is a FIFO (First In First Out) structure. The easiest way to think about a queue is to think of a line of people waiting to enter a building. The person at the beginning of the line will enter the building first, while the person at the end will enter last.You can enqueue an element in this structure, which means inserting the element to the end of the queue. You can also dequeue an element, which means deleting an element from the beginning of the queue.Queues are often used to manage threads in multithreading, and they are (not surprisingly) used to implement priority queuing systems.<br />

Wikipedia: https://en.wikipedia.org/wiki/Queue_(abstract_data_type)<br />

<p style="text-align: center"><img width="400" src="./assets/data-structure/queue.png" /></p>

# Hash-Table

A hash table structure associates each value with a key and then stores them. This makes it easy to look up values efficiently using a key. It’s an efficient way to insert and search for data regardless of its size, as it makes it easy to identify a specific object from a group of similar objects.

For example, if you go to college, you may be assigned a unique student ID number. This ID number is a key that can be used to retrieve information about you and your student record.

A hash table uses what’s known as a “hash function” to map a data set of any size to one of a fixed size—the hash table. The values that a hash function returns are known as “hash values.”

Hash tables are commonly used to create database indexes, to create associative arrays and to create a “set.”<br />
A hash table structure associates each value with a key and then stores them. This makes it easy to look up values efficiently using a key. It’s an efficient way to insert and search for data regardless of its size, as it makes it easy to identify a specific object from a group of similar objects.For example, if you go to college, you may be assigned a unique student ID number. This ID number is a key that can be used to retrieve information about you and your student record.A hash table uses what’s known as a “hash function” to map a data set of any size to one of a fixed size—the hash table. The values that a hash function returns are known as “hash values.”Hash tables are commonly used to create database indexes, to create associative arrays and to create a “set.”<br />

Wikipedia: https://en.wikipedia.org/wiki/Hash_table<br />

<p style="text-align: center"><img width="400" src="./assets/data-structure/hash-table.png" /></p>

# Array

One of the simplest data structures, an array is a collection of items that are stored sequentially. An array contains values or variables—known as “elements”—of the same data type and is of a fixed size, so you cannot change the size of an array. Each item in an array is indexed starting with 0.

The best way to think about an array is like a weekly medication organizer. It includes small containers lined up in a sequence, and each container has elements inside.

One of the simplest data structures, an array is a collection of items that are stored sequentially. An array contains values or variables—known as “elements”—of the same data type and is of a fixed size, so you cannot change the size of an array. Each item in an array is indexed starting with 0.The best way to think about an array is like a weekly medication organizer. It includes small containers lined up in a sequence, and each container has elements inside.
Arrays are commonly used as structures for building other, more complicated data structures. They are also used for sorting algorithms.<br />

Wikipedia: https://en.wikipedia.org/wiki/Array<br />
Expand All @@ -67,9 +56,7 @@ Wikipedia: https://en.wikipedia.org/wiki/Linked_list#:~:text=In%20computer%20sci
# Heap

Similarly, a heap is a type of binary tree in which the parent nodes are compared to their children. This allows the values within the nodes to be arranged accordingly. Heaps can be represented as trees, but they can also be represented as binary arrays.

There are two types of heaps. In a min heap, the parent’s key is less than or equal to the keys of its children. In a max heap, the parent’s key is greater than or equal to the keys of its children.

Heaps are often used in algorithms to create priority queues, and to find the smallest or largest value in an array.<br />

Wikipedia: https://en.wikipedia.org/wiki/Heap_(data_structure)<br />
Expand Down
1 change: 1 addition & 0 deletions dist/index-min-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/algorithm-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions dist/utils/algorithms/binary-search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/algorithms/binary-search.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions dist/utils/algorithms/bubble-sort.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/algorithms/bubble-sort.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dist/utils/algorithms/bucket-sort.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/algorithms/bucket-sort.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions dist/utils/algorithms/counting-sort.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/algorithms/counting-sort.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions dist/utils/algorithms/cycle-sort.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/utils/algorithms/cycle-sort.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions dist/utils/algorithms/dijstras-algorithm.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/utils/algorithms/dijstras-algorithm.js.map

This file was deleted.

19 changes: 0 additions & 19 deletions dist/utils/algorithms/hash-function.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/utils/algorithms/hash-function.js.map

This file was deleted.

Loading

0 comments on commit 6650cea

Please sign in to comment.