Time and Space Complexity In Algorithms, Beginners Guide

Multiple algorithms with different implementation to solve single problem.

Asymptotic Notations

Big Oh(O) with different time complexity.

Space and Time Complexity

Example of Time and Space Complexity

public int linearSearch(String[] arr, String element) {
for (int i = 0; i < arr.length; i++) {
if(arr[i].equals(element)) {
return i;
}
}
return -1;
}

Conclusion

--

--

--

Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Harry Potter and the CLI Project

Rotate Array

Comparison Between Flutter Vs React Native [Complete Guide 2022]

Which Tool Enables Me Converting Any Text Into MP3?

MLOps vs DevOps. What’s the difference?

Personal macOS Workspace Setup

Microsoft rolls out an update for Visual Studio 2017 Release Candidate

Get Raspberry Pi PICO Running on RT-Thread RTOS with an Opensource Light Versatile Graphics Library

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akash Jain

Akash Jain

Software Engineer

More from Medium

Greedy Algorithms

Detail of binary search

ALGORITHM a way to make programs easier

Another All Pair Shortest Path Algorithm-Johnson’s Algorithm