oreillymedia / data_structures_and_algorithms_using_javascript

768 stars 407 forks source link

Chapter 12: no CArray.js file #8

Open 404pnf opened 9 years ago

404pnf commented 9 years ago

Either make a copy of Chap12-1.js and rename it to CArray.js or make a symbolic link. Or else codes won't run,

$ grep 'load("CArray.js")' *
Chap12-10.js:load("CArray.js")
Chap12-11.js:load("CArray.js")
Chap12-12.js:load("CArray.js");
404pnf commented 9 years ago

Can't run Chap12-[10, 11, 12, 14].js unless

  1. copy Chap12-1.js to CArray.js
  2. copy code in Chap12-[10, 11, 12, 14].js to CArray.js and add

   this.shellsort1 = shellsort1;
   //this.shellsort = shellsort;
   this.mergeSort = mergeSort;
   this.mergeArrays = mergeArrays;

Is this expected?

I see the problem. The js file strictly mirrors what in the book. So those methods are not added to CArray.js. But one has to do all the above to make those codes run properly.

karent commented 9 years ago

I've contacted to author to address your questions about the code examples. Hopefully we'll have an answer to your query shortly.