Giter VIP home page Giter VIP logo

algorithms-playground's Introduction

1 - Basic Array Manipulation:

Problem Statement: Given an array of integers, rotate it by 'k' steps to the right. Example: For [1,2,3,4,5] with k=2, the result would be [4,5,1,2,3].

Explanation

2 - Anagram

Introduction and Goal:

An anagram is a word or phrase that is created by rearranging the letters of another word or phrase, using all the original letters exactly once. The goal of this problem is to determine if two given strings are anagrams of each other. For instance, the words "listen" and "silent" are anagrams.

Explanation

3 - Stack with Two Queue

The goal is to implement a queue using two stacks. A queue follows the First-In-First-Out (FIFO) principle, whereas a stack follows the Last-In-First-Out (LIFO) principle. By cleverly using two stacks, we can emulate the behavior of a queue.

Explanation

4 - Linked List

A linked list is a linear data structure where each element is a separate object. Each element (which we will call a "node") of a list consists of two items:

  1. The data (in case, an integer value).
  2. A reference (or "link") to the next node in the sequence.

Explanation

5 - Binary Search Tree (BST)

A Binary Search Tree is a binary tree data structure where each node has at most two children, referred to as the left child and the right child. For each node, all elements in the left subtree are less than the node, and all elements in the right subtree are greater than the node.

Diagram:

       5
     /   \
    3     7
   / \   / \
  1   4 6   8

In the above diagram:

  • Node 5 is the root.
  • 3 and 7 are children of 5.
  • 1 and 4 are children of 3.
  • 6 and 8 are children of 7.

Explanation

algorithms-playground's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.