Photo by Tine Ivanič on Unsplash

In this article, we will learn how to reverse a string using recursion in JavaScript. Firstly, we need to understand recursion, and what will be its role in reversing the string.

What is recursion?

Recursion is when a method calls itself until a terminating condition is met. Let us understand it using an example.

Example

We have a function: add(n). This function will add all numbers from and including n down to 1. …


Photo by Pierre Binet on Unsplash

In this article, we will learn how to reverse a Stack using a Queue in JavaScript. Firstly, we need to understand what Stacks and Queues are.

What is a Stack?

A stack is a linear data structure that follows a particular order in which the operations are performed. The order is Last In First Out (LIFO).


Photo by Johnson Wang on Unsplash

In this article, we will learn how to reverse a string using a stack in JavaScript.

What is a stack?

A stack is a linear data structure that follows a particular order in which the operations are performed. The order is Last In First Out (LIFO).


Photo by Artem Sapegin on Unsplash

Introduction

Let us first start by answering this question: What will be the code's output given below?


Photo by Eaters Collective on Unsplash

You might have heard about something called Stack Overflow. No, I am not talking about the famous platform for developers, but it’s a concept; moreover, it’s a situation. In this article, we will understand the situation, stack overflow in Javascript! But before jumping to it, we need to understand what a call stack is?

What is the call stack?

Through the call stack, the interpreter keeps track of any functions that are called when the script is executed. The way through which the call stacks work is pretty simple. It follows these steps:

  1. When the script calls a function, it is added to a call…


Photo by Melanie Pongratz on Unsplash

Introduction

In this article, we will learn how to implement a queue using an array in Javascript! A basic implementation of the queue data structure will be done with the methods:

  1. enqueue() — Adds an element to the queue
  2. dequeue() — Removes and returns the first item entered in the queue
  3. isEmpty() — Returns true or false based on if the queue is empty or not
  4. front() — Returns the front element of the queue
  5. print() — Returns all the elements of the queue


Photo by Adrien Delforge on Unsplash

The basics

A queue is a linear data structure that follows an order in which the elements can be accessed. It is very similar to stacks, but the only difference is that a queue is open on both ends. One end is used to add elements, and the other end is used to remove elements. The technical term for adding and removing elements is called Enqueue and Dequeue, respectively.


The client-server architecture is a widespread architecture used by almost every web application. Very few web apps use a different kind of architecture called Peer to Peer.

The client-server architecture is the very fundamental building block of the web. The whole architecture works based on a request-response model.


Before explaining single-tier applications, let us first understand the term “tier.” We can think of tiers are layers. These layers are divided into three parts: Presentation Layer (User Interface), Application Layer (Backend Login), Data Layer (Database). Now let us understand the use of these layers.

Presentation Layer: The presentation layer is also known as the client layer. This is the topmost level of an application. This layer’s primary function is to translate results into an interface that the end-user can understand.

Application Layer: This layer contains the business logic of the application. This data helps in the processing of the…


Introduction

Packets are the basic units of communication over a TCP/IP network. The data sent over the TCP connection is broken up into small groups that are termed packets. Each packet contains a small amount of data and other important information, such as the packet’s destination. The packets then travel through the network and reach their final destination. Only bits, Os and 1s, travel over media (If you are unaware about bits and bytes, here is a good resource).

Megh Agarwal

I am a high school student 🏫 and have an enthusiasm for computer science 💥. I am a person with full determination towards my future goals ❗ ❗.

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