This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | Indexing (Average) | Search (Average) | Insertion (Average) | Deletion (Worst) | Indexing (Worst) | Search (Worst) | Insertion (Worst) | Deletion (Worst) | Space | |
---|---|---|---|---|---|---|---|---|---|---|
Basic Array | O(1) | O(n) | Undefined | Undefined | O(1) | O(n) | Undefined | Undefined | O(n) | |
Dynamic Array | O(1) | O(n) | O(n) | O(n) | O(1) | O(n) | O(n) | O(n) | O(n) | |
Singly-Linked List | O(n) | O(n) | O(1) | O(1) | O(n) | O(n) | O(1) | O(1) | O(n) | |
Doubly-Linked List | O(n) | O(n) | O(1) | O(1) | O(n) | O(n) | O(1) | O(1) | O(n) | |
Skip List | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(n) | O(n) | O(n) | O(n) | O(n log(n)) | |
Hash Table | Undefined | O(1) | O(1) | O(1) | Undefined | O(n) | O(n) | O(n) | O(n) | |
Binary Search Tree | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(n) | O(n) | O(n) | O(n) | O(n) | |
Cartresian Tree | Undefined | O(log(n)) | O(log(n)) | O(log(n)) | Undefined | O(n) | O(n) | O(n) | O(n) | |
B-Tree | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(log(n)) | O(n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="error-panel callout alert" v-if="categoryError"> | |
<h2> | |
Invalid category selected: '{{ selectionJson.rootCategory }}<span v-if="selectionJson.category">/{{ selectionJson.category }}</span>'. | |
</h2> | |
<div class="sub-text"> | |
To continue browsing, please return to the <ps-page-navigator page="home" link-text="home page"></ps-page-navigator>. | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="plp-wrapper" :class="{'adjust-wrapper-background-scroll-plp': dockFacetMenuListToTop}"> | |
<facet-menu-list-reflektion | |
:rfk-facets="rfkFacets" | |
:facet-selections="selectedFacets" | |
:preselected-facets="urlParams" | |
:rfk-page-config="rfkPageConfig" | |
:rfk-sort-options="rfkSortOptions" | |
id="facet-menu-list" | |
:class="{ 'ps-is-stuck' : !inView.stickyWrapper && (isTouchScreen || storeScrollPosition > minimumScrollPositionForFacetsSticky), 'adjust-with-warning-without-toolbar': stickyWarningOn && !inView.stickyWrapper, 'dock-facets-to-top': dockFacetMenuListToTop && !stickyWarningOn}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number} k | |
*/ | |
var MyCircularQueue = function(k) { | |
this.arr = new Array(k); | |
this.headCount = 0; | |
this.tailCount = 0; | |
}; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require("webpack"); | |
const webpackMerge = require("webpack-merge"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const path = require("path"); | |
const modeConfig = env => require(`./modes/webpack.${env}.js`)(env); | |
const pluginConfig = require("./loadPlugins"); | |
module.exports = ({ mode, presets } = { mode: "development", presets: [] }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//uppercase.js | |
function uppercase(str, callback) { | |
callback(str.toUpperCase()) | |
} | |
module.exports = uppercase | |
//uppercase.test.js | |
const uppercase = require('./src/uppercase') | |
test(`uppercase 'test' to equal 'TEST'`, (done) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SoundPlayer from './sound-player'; | |
const mockPlaySoundFile = jest.fn(); | |
jest.mock('./sound-player', () => { | |
return jest.fn().mockImplementation(() => { | |
return {playSoundFile: mockPlaySoundFile}; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends React.Component { | |
state = { clicked: false, initialized: false }; | |
componentDidMount() { | |
this.setState({ initialized: true }); | |
} | |
setClicked = () => { | |
this.setState({ clicked: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const [initialized, setInitialized] = useState(false); | |
const [clicked, setClicked] = useState(false); | |
useEffect(() => { | |
setInitialized(true); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const [firstName, setFirstName] = useState(""); | |
const [middleName, setMiddleName] = useState(""); | |
const [lastName, setLastName] = useState(""); | |
return ( | |
<div className="App"> | |
<PersonalInformation | |
firstName={firstName} | |
middleName={middleName} |
NewerOlder