• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
中二病程序猿
博客园 首页 新随笔 联系 订阅 订阅 管理
上一页 1 2 3 下一页

2014年7月9日

CTCI 3.4
摘要: In the classic problem of the Towers of Hanoi, you have 3 towers and Ndisks of different sizes which can slide onto any tower.The puzzle starts with d... 阅读全文
posted @ 2014-07-09 20:23 中二病程序猿 阅读(162) 评论(0) 推荐(0)
 
CTCI 3.1
摘要: Describe how you could use a single array to implement three stacks.Divide the array into three fixed parts, each stands for a stack./*Fixed Size Stac... 阅读全文
posted @ 2014-07-09 18:26 中二病程序猿 阅读(169) 评论(0) 推荐(0)
 
 

2014年7月8日

CTCI 2.7
摘要: Implement a function to check if a linked list is a palindrome.Reverse the second half of the list and then compare it with the first half./* Assume t... 阅读全文
posted @ 2014-07-08 21:44 中二病程序猿 阅读(214) 评论(0) 推荐(0)
 
CTCI 2.6
摘要: Given a circular linked list, implement an algorithm which returns the node at the beginning of the loop.DEFINITIONCircular linked list: A (corrupt) l... 阅读全文
posted @ 2014-07-08 20:46 中二病程序猿 阅读(189) 评论(0) 推荐(0)
 
CTCI 2.5
摘要: You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the Ts d... 阅读全文
posted @ 2014-07-08 19:18 中二病程序猿 阅读(243) 评论(0) 推荐(0)
 
CTCI 2.4
摘要: Write code to partition a linked list around a value x, such that all nodes less than x come before all nodes greater than or equal to x.Use two addit... 阅读全文
posted @ 2014-07-08 17:39 中二病程序猿 阅读(150) 评论(0) 推荐(0)
 
 

2014年7月7日

CTCI 2.3
摘要: Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node.EXAMPLEInput: the node c from the linked... 阅读全文
posted @ 2014-07-07 23:40 中二病程序猿 阅读(98) 评论(0) 推荐(0)
 
CTCI 2.2
摘要: Implement an algorithm to find the kth to last element of a singly linked list.Classical "Runner" Technique of linkedlist/*Use two pointers, forward o... 阅读全文
posted @ 2014-07-07 22:14 中二病程序猿 阅读(146) 评论(0) 推荐(0)
 
CTCI 2.1
摘要: Write code to remove duplicates from an unsorted linked list.FOLLOW UPHow would you solve this problem if a temporary buffer is not allowed?/* Use a H... 阅读全文
posted @ 2014-07-07 21:14 中二病程序猿 阅读(252) 评论(0) 推荐(0)
 
 

2014年7月6日

CTCI 1.8
摘要: Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is a ... 阅读全文
posted @ 2014-07-06 20:14 中二病程序猿 阅读(210) 评论(0) 推荐(0)
 
 
上一页 1 2 3 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3