Code Monkey home page Code Monkey logo

algorithms's Introduction

Algorithms Study Cases

This repo contains most common algorithms and DS implementations. Solution are implemented in c++ or python.

To execute implemented tasks please follow the instructions in wiki of this repo.

Makefiles are provided: wiki

The list of implemented tasks is represented in Readme.md.

Descriptions for each task and solution are in folders (click on links in task lists).

Current List:

Stack & Queue: c++

  1. Stack implemented with Linked List: stack_linked_list/
  2. Queue implemented with Linked List: queue_linked_list/
  3. Special Stack with getMin() method: special_stack/
  4. Stack implemented from a Queue: stack_queue/
  5. Queue implemented from a Stack: queue_stack/

Linked List: c++

  1. Implementation of a class: implementation/
  2. Detect and Remove cycle: detect_remove_loop/

Sorting: c++

  1. Selection Sort selection_sort
  2. Insertion Sort insertion_sort
  3. Merge Sort merge_sort
  4. Heap Sort heap_sort

Binary Min Heap: c++

  1. Implementation of a class: implementation

Trees: c++ | python

  1. Binary Heap: c++

  2. Binary Search Tree: c++

    1. Implementation: c++ bst, avl
    2. Traversals: c++
    3. Applications: c++
      • In-order Successor: c++
      • Lowest Common Ancestor for two nodes in BST: c++
      • 2nd Largest Node in BST: c++
      • Non-related nodes in BST: c++
      • Determine if two trees are equal: c++
  3. Binary Tree Applications:

    1. All Paths With Sum python
    2. Duplicated Subtrees python
  4. Weighted Tree

Dynamic programming: python

  1. Edit Distance: python
  2. Longest Increasing Subsequence: python

Recursion:

  1. Edit Distance: python
  2. Longest Increasing Subsequence: python

algorithms's People

Contributors

alenalifar avatar usetheapi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

algorithms's Issues

Readme for local folders

all folders must contain Readme with description of a task or data structure with notes to implementation

Duplicated Subtrees

Given a binary tree, find all duplicate subtrees. For each duplicate subtrees, we only need to return the root node of any one of them. Two trees are duplicate if they have the same structure with same node values.

Optimal BST

Finding optimal BST which keys are assigned weights (searching priorities), which cost of weights + depths(i) is minimum. Greedy solution is to pick the biggest weight node and place it in the root of the tree, but if both key and weight are max then resulting BST is unbalanced and not optimal

Sum closest to 0

Given an array of integers, find two numbers whose sum is closest to 0

BST Parent pointer

Some of the tasks like non-recursive traversals etc. must use parent pointer.

Graphs Representations

There is no way to particularly create Directed Graph yet. Need to come up with elegant solution to give an option during the test

BST implementation

Bst implementation within one class is causing problems in use and data duplication into root pointer. TNode struct is required to be implemented.

Project Structure

Some of the files are not correctly suitable for new structure. Need to refactor

Solution of arrays/two_arrays_pairs/

The Dynamic Programming approach doesn't work with all possible cases. Probably DP is not suitable approach for this task. Need to come up with effective solution time complexity of which is better then O(n^2)

Consecutive numbers

Given an array of integers, find the max length of consecutive numbers present in array. The numbers don't need to be in order. Ex. 7 1 5 3 9 2 4 => Ans.: 1 2 3 4 5

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.