当前位置: 首页 > news >正文

搜索引擎如何找到网站深圳建筑公司招聘信息

搜索引擎如何找到网站,深圳建筑公司招聘信息,网站开发建设需要多少钱,塘厦镇网站建设这个题目涉及的是将一组具有父子关系的扁平数据转换为树形结构#xff0c;通常称为“树形结构的构建”问题。类似的题目包括#xff1a; 1. 组织架构转换 给定一个公司的员工列表#xff0c;每个员工有 id 和 managerId#xff0c;其中 managerId 表示该员工的上级。任务…这个题目涉及的是将一组具有父子关系的扁平数据转换为树形结构通常称为“树形结构的构建”问题。类似的题目包括 1. 组织架构转换 给定一个公司的员工列表每个员工有 id 和 managerId其中 managerId 表示该员工的上级。任务是将这个员工列表转换为一个树形的组织架构。 示例 const employees [{ id: 1, name: CEO, managerId: null },{ id: 2, name: CTO, managerId: 1 },{ id: 3, name: Engineer 1, managerId: 2 },{ id: 4, name: Engineer 2, managerId: 2 },{ id: 5, name: CFO, managerId: 1 },{ id: 6, name: Accountant, managerId: 5 } ];目标 将这些数据转换为组织架构树。 const ROOT_MANAGER_ID null;function buildOrgChart(employees) {const map new Map();let roots [];employees.forEach((employee) {map.set(employee.id, { ...employee, subordinates: [] });});employees.forEach((employee) {const currentEmployee map.get(employee.id);const managerId employee.managerId;if (managerId ROOT_MANAGER_ID) {roots.push(currentEmployee); // 如果没有经理就认为是根节点} else {const manager map.get(managerId);if (manager) {manager.subordinates.push(currentEmployee); // 将下属添加到经理的子节点数组} else {console.error(Invalid managerId ${managerId} for employee with id ${employee.id});}}});return roots; }const orgChart buildOrgChart(employees); console.log(JSON.stringify(orgChart, null, 2));2. 文件夹和文件结构 给定一个文件夹和文件列表每个文件或文件夹有 id、name 和 parentId表示文件夹和文件之间的层级关系任务是构建文件夹和文件的层级树。 示例 const items [{ id: 1, name: root, parentId: null },{ id: 2, name: Folder 1, parentId: 1 },{ id: 3, name: File 1, parentId: 2 },{ id: 4, name: File 2, parentId: 2 },{ id: 5, name: Folder 2, parentId: 1 },{ id: 6, name: File 3, parentId: 5 } ];目标 将文件夹和文件转换为树形结构。 const ROOT_PARENT_ID null;function buildFileStructure(items) {const map new Map();let roots [];items.forEach((item) {map.set(item.id, { ...item, children: [] });});items.forEach((item) {const currentItem map.get(item.id);const parentId item.parentId;if (parentId ROOT_PARENT_ID) {roots.push(currentItem); // 如果没有父文件夹则认为是根文件夹} else {const parent map.get(parentId);if (parent) {parent.children.push(currentItem); // 将当前文件或文件夹添加到父节点的 children 数组} else {console.error(Invalid parentId ${parentId} for item with id ${item.id});}}});return roots; }const fileStructure buildFileStructure(items); console.log(JSON.stringify(fileStructure, null, 2));3. 评论/回复树 给定一组评论数据其中每个评论包含 id、parentId 和 content任务是将这些评论转换为树形结构其中 parentId 为 null 或 0 表示根评论。 示例 const comments [{ id: 1, parentId: null, content: First comment },{ id: 2, parentId: 1, content: Reply to first comment },{ id: 3, parentId: 1, content: Another reply to first comment },{ id: 4, parentId: 2, content: Reply to reply } ];目标 将评论转换为树形结构。 const ROOT_PARENT_ID null;function buildCommentTree(comments) {const map new Map();let roots [];comments.forEach((comment) {map.set(comment.id, { ...comment, replies: [] });});comments.forEach((comment) {const currentComment map.get(comment.id);const parentId comment.parentId;if (parentId ROOT_PARENT_ID) {roots.push(currentComment); // 如果没有父评论则认为是根评论} else {const parent map.get(parentId);if (parent) {parent.replies.push(currentComment); // 将当前评论添加到其父评论的 replies 数组} else {console.error(Invalid parentId ${parentId} for comment with id ${comment.id});}}});return roots; }const commentTree buildCommentTree(comments); console.log(JSON.stringify(commentTree, null, 2));4. 分类树 给定商品分类列表其中每个分类有 id、parentId 和 name任务是将这些分类转换为树形结构。 示例 const categories [{ id: 1, name: Electronics, parentId: null },{ id: 2, name: Computers, parentId: 1 },{ id: 3, name: Laptops, parentId: 2 },{ id: 4, name: Smartphones, parentId: 1 } ];目标 将分类列表转换为树形结构。 const ROOT_PARENT_ID null;function buildCategoryTree(categories) {const map new Map();let roots [];categories.forEach((category) {map.set(category.id, { ...category, subcategories: [] });});categories.forEach((category) {const currentCategory map.get(category.id);const parentId category.parentId;if (parentId ROOT_PARENT_ID) {roots.push(currentCategory); // 根分类} else {const parent map.get(parentId);if (parent) {parent.subcategories.push(currentCategory); // 添加子分类} else {console.error(Invalid parentId ${parentId} for category with id ${category.id});}}});return roots; }const categoryTree buildCategoryTree(categories); console.log(JSON.stringify(categoryTree, null, 2));这些题目都涉及构建树形结构核心的思想是遍历节点将每个节点的父子关系映射到树形结构上通常会用到哈希表如 Map来缓存节点以避免多次查找。 评定指标 性能方面 加载性能通过工具测量 FCP首次内容绘制和 LCP最大内容绘制指标理想的 FCP 应在1.8秒内LCP 应在2.5秒内。TTFB首字节时间也很关键其理想时间应在800毫秒内该指标反映了服务器响应速度及网络传输等综合情况.交互性能FID首次输入延迟测量用户首次交互到浏览器响应的时间应在100毫秒内响应用户输入。TBT总阻塞时间反映长任务对主线程的阻塞情况移动设备上应低于300毫秒桌面 Web 上应低于100毫秒.渲染性能动画或滚动需在10毫秒内生成每一帧以保证视觉平滑。可查看页面在滚动、切换等交互时的动画效果是否流畅.资源优化查看页面的 HTTP 请求数量和资源大小合理减少请求数量、压缩资源文件如压缩 CSS、JavaScript 和图片等可加快页面加载速度. 稳定性方面 页面布局稳定性CLS累积布局偏移用于衡量页面布局在加载过程中的变化情况其值应控制在0.1以内以确保用户浏览时页面元素不会出现意外的大幅移动.兼容性检查页面在不同浏览器、不同设备及不同屏幕分辨率下的显示和交互是否正常确保网站的兼容性提高用户体验的一致性。错误处理查看控制台是否有 JavaScript 错误、资源加载失败等问题若有则会影响页面的正常功能和稳定性需及时修复。性能的一致性在不同的网络环境下如宽带、4G、5G 等页面的性能表现应相对稳定不会出现因网络波动而导致页面长时间无法加载或频繁出错的情况 。
http://www.dnsts.com.cn/news/67964.html

相关文章:

  • 网站制作公司去哪找wifi优化大师下载
  • 品牌网站建设公司推荐网页制作教程答案
  • wix做的网站在国内访问不阳江房产网查询系统
  • 三河做网站甘肃省住房和城乡建设厅官方网站
  • 网站开发作业总结wordpress访问源端口号
  • 优秀的手机网站案例分析网站建设的创新之处
  • 杭州网站优化排名网站推广seo是什么
  • 网站申请要多少钱乐清建设网站公司
  • 重庆集团公司网站建设网络商城推广方案
  • 小米网站建设快速建站学什么
  • top域名的网站打不开seo服务公司推荐
  • 肇庆网站建设方案电商网站建设多少钱
  • 做网站前端后端ui什么意思企业网站建设规划的基本原则有哪些
  • 长沙哪里有网站推广优化网站开发外包价格
  • 做智能网站南京建设个人网站
  • 德州网站制作公司云星穹铁道网页版入口
  • 新手如何学网站建设wordpress 添加菜单
  • 手机版官方网站的建设朔州网站建设电话
  • 安卓端网站开发ide网站备案流程多少钱
  • 网站整合建设是啥意思网站开发都用php
  • 用excel 做网站徐州网上阳光招生平台
  • 网站托管如何收费做淘客网站简单吗
  • 手机网站模板尺寸企业做网站etp和源程序
  • dedecms景区网站模板厦门建设网站建站
  • 深圳专业网站开发公司短视频运营培训学费多少
  • 网站中的文字滑动怎么做的关键词排名优化系统
  • 建设电子商务平台网站毕设做桌面软件还是网站
  • 帮人网站开发维护违法国投集团网站开发
  • 富蕴县建设局网站做视频用的网站
  • 做网站和做免费推广网站的区别建网站的电脑可以换位置吗