freeCodeCamp/curriculum/challenges/arabic/08-coding-interview-prep/data-structures/adjacency-list.arabic.md

1.2 KiB

id title challengeType videoUrl localeTitle
587d8256367417b2b2512c77 Adjacency List 1

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(Object.keys(undirectedAdjList).length === 4, "<code>undirectedAdjList</code> should only contain four nodes.");'
  - text: ''
    testString: 'assert(undirectedAdjList.James.indexOf("Jeff") !== -1 && undirectedAdjList.Jeff.indexOf("James") !== -1, "There should be an edge between <code>Jeff</code> and <code>James</code>.");'
  - text: ''
    testString: 'assert(undirectedAdjList.Jill.indexOf("Jenny") !== -1 && undirectedAdjList.Jill.indexOf("Jenny") !== -1, "There should be an edge between <code>Jill</code> and <code>Jenny</code>.");'
  - text: ''
    testString: 'assert(undirectedAdjList.Jeff.indexOf("Jenny") !== -1 && undirectedAdjList.Jenny.indexOf("Jeff") !== -1, "There should be an edge between <code>Jeff</code> and <code>Jenny</code>.");'

Challenge Seed

var undirectedAdjList = {
};

Solution

// solution required