Arrays, Strings, and HashMaps

Arrays, Strings, and HashMaps

Data structures like arrays, strings, and hashmaps are available by default in most programming languages. They facilitate storage of large amounts of data in an efficient format which makes it easier (and sometimes relatively faster) to access during runtime. Arrays An array is a sequential store of data (referred to as elements). In languages like Python, an array can store elements with multiple data types, like, [1, "Hello, World", True] but for languages like Go, C++, and Java an array can store elements of a singular data type....

September 29, 2023 · 8 min · Avnish
Time Complexity Comparison of Algorithms

Time Complexity

While programming allows us to create virtually anything, the true test of performance arises when we deploy the same code on a significantly larger scale. Time Complexity ($T(n)$) is a function that estimates the execution time of an algorithm given the amount of data to be processed as its input ($n$). It is a common benchmark used to measure an algorithm’s performance. Bounds of Time Complexity The output of the time complexity function will be a close estimate of an algorithm’s runtime given the size of its input but it does not consider other characteristics of the input that could affect its runtime....

September 22, 2023 · 8 min · Avnish

REST API Requests in Go

What is REST? REST (REpresentational State Transfer) is an architectural style for designing and developing APIs that could be used for client and server interactions. REST defines 6 architectural constraints for APIs: Uniform interface: API requests for a resource should look the same irrespective of its origin client. The Uniform Resource Identifier (URI) allocated to resources should be unique. Client-server: Changes on the client side should not affect the server and vice-versa....

September 15, 2023 · 6 min · Avnish

Concurrency in Go

We can make a program concurrent if we can split it as multiple independent tasks executed at the same time. In concurrency, we execute different portions of a program at the same time (on single or multiple CPU threads) whereas in parallelism a singular task (or subtasks) is executed parallelly on multiple CPU threads. Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once....

September 12, 2023 · 8 min · Avnish

File Handling in Go

Reading and writing files is one of the most common tasks in programming projects. Using this skill we can store data persistently and decrease the memory consumption of our program. Paths The path/filepath package provides filepath.Join() function to create filesystem paths for files and directories. The same could also be achieved with string concatenation in Go but it won’t be interoperable between different operating systems (Linux uses the forward slash (/) for separators in the path whereas Windows uses the backward slash (\))....

June 27, 2023 · 10 min · Avnish