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

简易网站的html代码电子商务网站的建设要求

简易网站的html代码,电子商务网站的建设要求,网页设计图片排版模板,建设局网站策划书关于力扣链表题需要本地调试创建链表的情况 我们在练习链表题,力扣官方需要会员,我们又不想开会员,想在本地调试给你们提供的代码 声明:本人也是参考的别人的代码,给你们提供不同语言生成链表 参考链接: 参…

关于力扣链表题需要本地调试创建链表的情况

我们在练习链表题,力扣官方需要会员,我们又不想开会员,想在本地调试给你们提供的代码
声明:本人也是参考的别人的代码,给你们提供不同语言生成链表
参考链接: 参考链接

1、编写代码:

C++版本

#include<iostream>struct ListNode {int val;ListNode* next;ListNode(int value) : val(value), next(nullptr) {}
};ListNode* createSList(int* nums, int sz) {ListNode* head = nullptr;ListNode* tail = nullptr;for (int i = 0; i < sz; ++i) {ListNode* newNode = new ListNode(nums[i]);if (tail == nullptr) {head = tail = newNode;} else {tail->next = newNode;tail = newNode;}}return head;
}void destroySList(ListNode* head) {while (head != nullptr) {ListNode* temp = head;head = head->next;delete temp;}
}int main() {int arr[] = {1, 2, 3, 4, 5, 6};int sz = sizeof(arr) / sizeof(arr[0]);ListNode* plist = createSList(arr, sz);// 在程序结束前释放链表占用的内存destroySList(plist);return 0;
}

JAVA版本

public class ListNode {int val;ListNode next;ListNode(int value) {val = value;next = null;}
}public class Main {static ListNode createSList(int[] nums) {ListNode head = null;ListNode tail = null;for (int num : nums) {ListNode newNode = new ListNode(num);if (tail == null) {head = tail = newNode;} else {tail.next = newNode;tail = newNode;}}return head;}static void destroySList(ListNode head) {while (head != null) {ListNode temp = head;head = head.next;temp = null;}}public static void main(String[] args) {int[] arr = {1, 2, 3, 4, 5, 6};ListNode plist = createSList(arr);// 在程序结束前释放链表占用的内存destroySList(plist);}
}

Python版本

class ListNode:def __init__(self, value):self.val = valueself.next = Nonedef create_slist(nums):head = Nonetail = Nonefor num in nums:new_node = ListNode(num)if tail is None:head = tail = new_nodeelse:tail.next = new_nodetail = new_nodereturn headdef destroy_slist(head):while head is not None:temp = headhead = head.nexttemp = Nonearr = [1, 2, 3, 4, 5, 6]
plist = create_slist(arr)# 在程序结束前释放链表占用的内存
destroy_slist(plist)

2、如何使用

在这里插入图片描述
例如我们想生成listA的链表
在这里插入图片描述

只需要修改这里,然后我们就可以得到生成这个链表
在这里插入图片描述
这样就可以得到我们需要的链表。

http://www.yayakq.cn/news/969300/

相关文章:

  • 第一模板网站怎么卸载2345网址导航
  • 南沙开发区建设和交通局网站男女做床上网站
  • 网站建设公司.程序员做一个网站多少钱
  • 给宝宝做辅食的网站公司网站如何被百度收录
  • 网站前台功能模块设计网站建设源程序清单
  • 金沙县建设局网站wordpress 归档
  • 深圳招聘网站有哪些分销商城系统源码
  • 自己建网站怎么推广福州seo按天收费
  • 网站开发服务费属于哪种进项网站的ftp账号和密码是什么
  • wordpress 目录布局aso应用商店优化
  • 手机自己怎么建电影网站汽车网络营销的方式有哪些
  • 协会建设网站的必要性教育app开发
  • 专业设计网站效果深圳网站制作建站
  • python做网站php新洲网站建设
  • 免费建站网站大全网站站建设建技设术技术
  • 做网站的软件m开头如何改进网站
  • 深圳o2o网站建设湖州建设培训入口网站
  • mvc5网站开发实战详解vs做网站链接sql
  • 上海网站建设千元漂亮做调研用到的大数据网站
  • 网站发展中国域名是
  • 使用免费网站制作软件wordpress加上live2d
  • 做暧暧网站在线看wap建站程序源码
  • 兰州网站搜索引擎优化广州建设工程质量安全网站
  • 网站 app微信三合一门户网站的建设目的
  • 怎样做网商网站网站建设培训哪里好
  • 网站关键词之间网站开发 职业环境分析
  • 站长统计工具asp网站开发教案
  • 网站流量下跌邢台信息网官网
  • 海南海口网站开发公司网站建设游戏公司
  • 企业网站建设可以分为( )交互层次dw软件入门教程