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
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

ikatyang/zigzag-traverse

Open more actions menu

Repository files navigation

zigzag-traverse

npm build coverage

zigzag-order traversal

Changelog

Install

# using npm
npm install --save zigzag-traverse

# using yarn
yarn add zigzag-traverse

Usage

const zigzag_traverse = require('zigzag-traverse');

zigzag_traverse([
   0,  1,  2,  3,  4,
   5,  6,  7,  8,  9,
  10, 11, 12, 13, 14,
  15, 16, 17, 18, 19,
], 5, value => console.log(value));
//=> 0 1 5 10 6 2 3 7 11 15 16 12 8 4 9 13 17 18 14 19

API

declare function zigzag_traverse<T, U extends ArrayLike<T>>(
  array: U,
  width: number,
  callback: (value: T, index: number, array: U) => void,
): void;

export = zigzag_traverse;

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika

About

zigzag-order traversal

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

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