Welcome to my Blog 馃憢

My blog is dedicated to competitive programming, Golang, and Rust programming language.

A detailed Segment Tree implementation in Golang

Segment Tree implementation in Golang

This article describes an advanced data structure called Segment Tree and provides implementation in the popular modern language Golang. We will solve a problem in SPOJ to show how we can use the Segment Tree in competitive programming. General Idea Segment Tree is an advanced tree data structure that allows you to answer range queries efficiently and modify the array quickly. Segment Tree is commonly used in competitive programming to solve problems in O(n log n) time. That includes finding the sum of consecutive array elements, minimum or maximum in the range, maximum consecutive range sum, etc. This structure is more flexible than Fenwick Tree and allows you to solve more complex problems but is more challenging in implementation. ...

July 17, 2022 路 10 min 路 Roka
Serverless application development in Golang with AWS

Serverless Golang with Lambda and DynamoDB

Serverless applications have been gaining popularity recently because of their scalability and simplicity. In this article, we will create a simple TODO application in Golang using serverless AWS technologies: Lambda, APIGateway, and DynamoDB. Project setup First of all, we should create the Golang project: mkdir todo-app-lambda cd todo-app-lambda go mod init github.com/CrazyRoka/todo-app-lambda touch main.go It will initialize the Golang project for you. Now we can write starting point for our application in main.go: ...

July 5, 2022 路 11 min 路 Roka
Advanced deserialization with Serde: Parsing Cloudformation templates

Advanced deserialization with Serde: Parsing Cloudformation templates

serde is a great library for Rust that allows you to serialize and deserialize your structs efficiently. In this article, we will review some advanced features of this library by parsing AWS Cloudformation templates. Cloudformation is an infrastructure as a code. It allows you to model your AWS resources inside the template. After that, AWS will provision all the resources in the correct order for you. It鈥檚 a powerful tool that is very popular nowadays. ...

March 28, 2022 路 10 min 路 Roka
Step by step guide to implement cross-platform support for Brainfuck in Rust

Cross-platform Brainfuck Interpreter implementation in Rust - Part 2

This article is the next part of Brainfuck interpreter implementation. We built the library that parses and executes Brainfuck language in the previous part. In this part, we will use this library in the CLI program and deploy the code to AWS Lambda. Let鈥檚 begin with the CLI. CLI program implementaiton Firstly, we need to create a new application in our workspace. In the terminal, go to the root workspace directory and run this command: ...

March 17, 2022 路 10 min 路 Roka
Step by step guide to implement Brainfuck language in Rust

Cross-platform Brainfuck Interpreter implementation in Rust - Part 1

Brainfuck is a highly minimalistic programming language created in 1993 by Swiss physics student Urban M眉ller. The language consists of only eight simple commands, a data pointer and an instruction pointer. In this article, we will implement a custom Brainfuck interpreter in Rust. Workspace setup Let鈥檚 create a workspace for our project: Create a folder with your workspace name. For example: brainfuck. Add file Cargo.toml with this content: [workspace] members = [ ] Create a brainfuck interpreter library: cargo new --lib brainfuck_interpreter Modify your outer Cargo.toml. You should add the new library name to the members list: [workspace] members = [ "brainfuck_interpreter", ] Now, we are ready to work with the interpreter. ...

March 17, 2022 路 7 min 路 Roka
Routing Table

Implementation of CIDR routing table in Rust

Classless Inter-Domain Routing (CIDR) is a method of allocating IP addresses. This method is used in low-level routing and other Computer Science fields, especially in the Cloud. For example, in AWS, you manage a VPC and subnets. They contain a set of IP ranges in the form of CIDR blocks. As I mentioned earlier, CIDR is used for routing. The main idea of routing is to identify the most exact CIDR block for a given IP address or indicate that such does not exist. This task becomes more complex when you have hundreds of thousands of CIDR blocks. ...

January 29, 2022 路 11 min 路 Roka
PriorityQueue

Priority Queue Implementation in Rust

This article will describe a more complex data structure called Priority Queue. We will implement it with a Binary Heap, a data structure that takes the form of a tree. ...

December 30, 2021 路 4 min 路 Roka
LinkedList

Rust Doubly Linked List Implementation

Doubly Linked List is the next fundamental collection that is useful to understand. It goes further from Singly Linked List by allowing appending elements from both sides, but this comes at the cost of more complex implementation. This article will cover all the details you need to implement this data structure in Rust. ...

December 27, 2021 路 8 min 路 Roka
SinglyLinkedList

Rust Singly Linked List Implementation

Singly Linked List is a fundamental data structure that every developer should implement in Rust. It鈥檚 simple enough to be implemented in several lines of code in C++ based languages but has some challenges in Rust implementation. This article will teach you to implement your own Singly Linked List. ...

December 26, 2021 路 8 min 路 Roka