Skip to content

Commit fd6489e

Browse files
committed
Move contents from Data_Structures_Questions.md to Data Structures sprint. Move checkBalanced exercise back as a standard criteria.
1 parent eac2260 commit fd6489e

File tree

3 files changed

+14
-85
lines changed

3 files changed

+14
-85
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sprint Challenge: Data Structures and Algorithms
22

3-
For this sprint challenge, you'll be implementing a few functions that build off of some of the data structures you implemented in the first half of the week. Then you'll be analyzing the runtimes of all of the data structure methods.
3+
For this sprint challenge, you'll be implementing a few functions that build off of some of the data structures you implemented in the first half of the week. Then you'll be analyzing the runtimes of these methods.
44

55
For the algorithms portion of the sprint challenge, you'll be answering the questions posed in the `exercises.pdf` file regarding runtime complexities and algorithmic paradigms.
66

@@ -12,13 +12,13 @@ Inside the `src` directory you'll also find the `heap.js` file with the complete
1212

1313
Run `npm test heap` to run the tests for your `heapsort` function to ensure that your implementation is correct.
1414

15-
### Task 2. Analyze some runtimes
16-
Open up the `Data_Structures_Answers.md` file. This is where you'll jot down your answers for the runtimes of the two functions you just implemented, as well as the methods you implemented for all of the data structures. Be sure to also answer any other questions posed in the `Answers.md` file!
17-
18-
### Stretch Task. Check if a binary search tree is balanced
15+
### Task 2. Check if a binary search tree is balanced
1916
Navigate into the `data_structures` directory. Inside the `src` directory, you'll see the `binary-search-tree.js` file with the completed code for the binary search tree class. Your first task is to write a separate function (not part of the `BinarySearchTree` class) that receives the root node of an instance of a binary search tree and returns `true` if the binary search tree is perfectly balanced, i.e., all the leaf nodes of the tree reside on the same level. Your function should return `false` if the tree is not perfectly balanced.
2017

2118
Run `npm test binary-search-tree` to run the tests for this function to ensure that your implementation is correct.
2219

20+
### Task 3. Analyze some runtimes
21+
Open up the `Data_Structures_Questions.md` file. This is where you'll jot down your answers for the runtimes of the two functions you just implemented.
22+
2323
## Algorithms
2424
For the algorithms portion of the sprint challenge, you'll be answering questions posed in the `exercises.pdf` document inside the `algorithms` directory. Add your answers to the questions in the `Algorithms_Answers.md` file.

data_structures/Data_Structures_Answers.md

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Add your answers to the questions below.
2+
3+
1. What is the runtime complexity of your `checkBalanced` function?
4+
5+
2. What is the space complexity of your `checkBalanced` function?
6+
7+
3. What is the runtime complexity of your `heapsort` function?
8+
9+
4. What is the space complexity of the `heapsort` function? Recall that your implementation should return a new array with the sorted data. What would be the space complexity if your function instead altered the input array?

0 commit comments

Comments
 (0)