Skip to content

Commit d3e3cc1

Browse files
authored
Update README.md organization (#9)
1 parent bc68c26 commit d3e3cc1

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Repository for examples of typical algorithm solutions and data structures in Javascript
66

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

1010
## Freecodecamp: Javascript Algorithms & Data Structures
1111

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

18-
## Leetcode
18+
## Algorithms
1919

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

2222
## Resources
2323

src/leetcode/arrays/README.md renamed to src/algorithms/arrays/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Arrays
22

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

66
## Merge Two Sorted Lists
77

src/leetcode/arrays/two_sum.js renamed to src/algorithms/arrays/two_sum.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
export default function (nums, target) {
1+
export default function(nums, target) {
32
const map = {};
43

54
for (let i = 0; i < nums.length; i += 1) {

src/leetcode/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/leetcode/merge_two_sorted_lists.test.js renamed to tests/algorithms/merge_two_sorted_lists.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { ListNode, mergeTwoLists } from '../../src/leetcode/arrays/merge_two_sorted_lists';
1+
import {
2+
ListNode,
3+
mergeTwoLists
4+
} from "../../src/algorithms/arrays/merge_two_sorted_lists";
25

36
function createList(arr) {
47
const head = new ListNode(arr[0]);
@@ -21,7 +24,7 @@ function getList(node) {
2124
return list;
2225
}
2326

24-
test('should merge two arrays', () => {
27+
test("should merge two arrays", () => {
2528
const l1 = createList([1, 2, 5, 8]);
2629
const l2 = createList([2, 3, 4, 6]);
2730
const ans = getList(mergeTwoLists(l1, l2));

tests/algorithms/two_sum.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import twoSum from "../../src/algorithms/arrays/two_sum";
2+
3+
test("should find sum", () => {
4+
expect(twoSum([2, 7, 11, 15], 9)).toEqual([0, 1]);
5+
});

tests/leetcode/two_sum.test.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)