Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ricksmith26/dataStructures

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures with the functional pattern

In this 1 day sprint you will be implementing 2 data structures that are commonly used in computer science: stacks and queues. You have already learned about one use of stacks: for keeping track of a pile of functions that are in the process of execution. A queue data structure would be useful on occasions where you want to process tasks in the same order as they arrive, such as in a messaging application or a printer queue.

Core Goals

  1. Research stacks and queues. Here is a good link https://en.wikibooks.org/wiki/Data_Structures/Stacks_and_Queues to get you started in your research. Make sure you understand how they operate internally and double check with us that you have a good understanding of their methods before you start.

  2. Implement these two data structures using the functional pattern explained in the lecture.

  3. Be sure to test your functions as you go.

  4. Implement each data structure in its own file with its own test file.

Important!

You may not use JavaScript arrays or any array methods or properties to implement your stack and queue structures. Everything should be implemented with objects and custom methods.

Advanced - only attempt these if you get through stacks and queues!

  1. Implement the set data structure. Sets have lots of potential methods you could implement so pick out a few that seem most useful/interesting and implement those.

  2. Implement the tree data structure. [Trees] (https://en.wikipedia.org/wiki/Tree_(data_structure)) also have a lot of methods, many of which may come into tomorrow's sprint. Focus today on implementing methods that add and remove data (e.g. addData, removeData) or return a boolean, (e.g. isParent, isRoot, hasSiblings, isLeaf). Look through the article for ideas on the terminology to use.

  3. If you finish this, have a look for other potential data structures and see if you can implement useful functions they may have.

Learning objectives

  • Fully understand the functional pattern of object creation in JavaScript, together with its pros and cons.
  • Learn, throughout the sprint, about the 4 rules of this in JavaScript.
  • Introduce yourself to data structures.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.