I hereby claim:
- I am monsieurkayode on github.
- I am monsieurkayode (https://keybase.io/monsieurkayode) on keybase.
- I have a public key ASAeOGQsqdib41KgHqsixCDs2au7P7M2nhbwQyI7kwCK4Qo
To claim this, I am signing this object:
=begin | |
SOLID Principles | |
---------------- | |
SOLID stands for a set of acronym that are guiding designing principles that help developers to | |
write clean and maintainnable source code modeled using an object oriented programming language. | |
This gist breaks down and explains each of the principle with example implemenntation code in Ruby | |
S -> Single Responsibility Principle (SRP) |
# Linear search implementation | |
# Iterates through all the elements in an Enumerable | |
# using a loop with a break condition and returns the index | |
# of the found element or -1 | |
# Space time complexity: O(n) | |
# Probably the least efficient of search algorithms expecially when traversing through large datasets. | |
def linear_search(data_set, element) | |
index = 0 | |
last_index = data_set.length - 1 |
I hereby claim:
To claim this, I am signing this object: