Skip to content

Update README.md organization #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Repository for examples of typical algorithm solutions and data structures in Javascript

- [Freecodecamp - Javascript Algorithms & Data Structures](#freecodecamp-javascript-algorithms--data-structures)
- [Leetcode](#leetcode)
- [Algorithms](#algorithms)

## Freecodecamp: Javascript Algorithms & Data Structures

Expand All @@ -15,9 +15,9 @@ Algorithms from the Freecodecamp Javascript algorithms and data structures certi
- [Intermediate Algorithms](./src/fcc-intermediate-algorithms/README.md)
- [Algorithm Projects](./src/fcc-course-projects/README.md)

## Leetcode
## Algorithms

- [Arrays](./src/leetcode/arrays/README.md)
- [Arrays](./src/algorithms/arrays/README.md)

## Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Arrays

* [Merge Two Sorted Lists](#merge-two-sorted-lists)
* [Two Sum](#two-sum)
- [Merge Two Sorted Lists](#merge-two-sorted-lists)
- [Two Sum](#two-sum)

## Merge Two Sorted Lists

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

export default function (nums, target) {
export default function(nums, target) {
const map = {};

for (let i = 0; i < nums.length; i += 1) {
Expand Down
1 change: 0 additions & 1 deletion src/leetcode/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ListNode, mergeTwoLists } from '../../src/leetcode/arrays/merge_two_sorted_lists';
import {
ListNode,
mergeTwoLists
} from "../../src/algorithms/arrays/merge_two_sorted_lists";

function createList(arr) {
const head = new ListNode(arr[0]);
Expand All @@ -21,7 +24,7 @@ function getList(node) {
return list;
}

test('should merge two arrays', () => {
test("should merge two arrays", () => {
const l1 = createList([1, 2, 5, 8]);
const l2 = createList([2, 3, 4, 6]);
const ans = getList(mergeTwoLists(l1, l2));
Expand Down
5 changes: 5 additions & 0 deletions tests/algorithms/two_sum.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import twoSum from "../../src/algorithms/arrays/two_sum";

test("should find sum", () => {
expect(twoSum([2, 7, 11, 15], 9)).toEqual([0, 1]);
});
5 changes: 0 additions & 5 deletions tests/leetcode/two_sum.test.js

This file was deleted.