題目描述 給定一個單向鏈表龄句,要求刪除從結(jié)尾數(shù)第n個結(jié)點钮惠,并返回修改后的表頭挂捅。 樣例 給定數(shù)組單向鏈表 1->2->3->4->5 晃跺,以及 n = 2 ,修改后的鏈表為 1->...
![240](https://cdn2.jianshu.io/assets/default_avatar/6-fd30f34c8641f6f32f5494df5d6b8f3c.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240)
題目描述 給定一個單向鏈表龄句,要求刪除從結(jié)尾數(shù)第n個結(jié)點钮惠,并返回修改后的表頭挂捅。 樣例 給定數(shù)組單向鏈表 1->2->3->4->5 晃跺,以及 n = 2 ,修改后的鏈表為 1->...
[LeetCode] Strobogrammatic Number 對稱數(shù) A strobogrammatic number is a number that looks t...
題目:題目地址 題目描述請設(shè)計一個棧結(jié)構(gòu),支持 push、pop脱吱、top以及getMin操作,且每個操作的時間復(fù)雜度都是 O(1)O(1)认罩。push(x) – 向棧中壓入元素...
模擬人工加法的過程箱蝠。 從低位到高位,依次計算出每一位數(shù)字,過程中需要記錄進位宦搬。如果最高位進位是1牙瓢,則需要將整個數(shù)組后移一位,并在第0個位置寫上1床三。
使用棧數(shù)據(jù)結(jié)構(gòu): 遇到左括號一罩,需要壓棧杨幼。 遇到右括號撇簿,判斷棧頂是否和當(dāng)前右括號匹配;若不匹配則返回false差购,否則匹配彈出棧頂四瘫。 最后判斷棧是否為空;若為空則合法欲逃,否則不合法找蜜。
leetcode Day 4 題目:Given an array nums, write a function to move all 0's to the end of i...
Question 求二叉樹的最大深度 Given a binary tree, find its maximum depth.The maximum depth is the...
正在復(fù)習(xí)C++,有理解不對的地方歡迎大家指正~
104. Maximum Depth of Binary TreeLeetcode Day 3 題目:Given a binary tree, find its maximum depth.The maximum depth is the ...
Leetcode Day 3 題目:Given a binary tree, find its maximum depth.The maximum depth is the ...
Leetcode Day 2 題目:The Hamming distance between two integers is the number of positions ...
題目:You're given strings J representing the types of stones that are jewels, and S repre...
Leetcode Day 1 136 Single Number 題目: Given a non-empty array of integers, every element...
Leetcode Day 1 344 Reverse String 題目:Write a function that takes a string as input and ...