Skip to content

A collection of algorithmic exercises where I solve common coding challenges using JavaScript, focusing on problem-solving, algorithmic thinking, and code implementation.

Notifications You must be signed in to change notification settings

sarafsg/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms

A collection of algorithmic exercises where I solve common coding challenges using JavaScript, focusing on problem-solving, algorithmic thinking, and code implementation. The project includes tests and edge case handling for each solution.


Included Exercises

1. Sorting Algorithm

  • Description: Sort a list of numbers using two different methods: insertion sort and selection sort.
  • Objective: Implement two separate functions that output a sorted array.
  • Example Input:
    [100, 95, 10, -10, 32, -55, 44, 10, 33, -564]
  • Example Output:
    [-564, -55, -10, 10, 10, 32, 33, 44, 95, 100]

2. Sum to Target

  • Description: Given a list of numbers and a target sum, determine if any two numbers add up to the target.
  • Objective: Return true if a valid pair is found, otherwise false.
  • Example Input:
    list = [10, 15, 3, 7], k = 17
  • Example Output:
    true (10 + 7 = 17)

3. Run-Length Encoding

  • Description: Encode a string using run-length encoding, which compresses repeated characters into a single count and character. Implement decoding as well.
  • Objective: Write functions for both encoding and decoding strings.
  • Example Input:
    "AAAABBBCCDAA"
  • Example Output:
    "4A3B2C1D2A"

4. Balanced Brackets

  • Description: Check if a string of round (), curly {}, and square [] brackets is balanced.
  • Objective: Return true if the brackets are well-formed, otherwise false.
  • Example Input:
    "([])"
  • Example Output:
    true

About

A collection of algorithmic exercises where I solve common coding challenges using JavaScript, focusing on problem-solving, algorithmic thinking, and code implementation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published