ZHENG_ZE_KAI
码龄8年
关注
提问 私信
  • 博客:4,467
    4,467
    总访问量
  • 21
    原创
  • 1,487,364
    排名
  • 0
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:广东省
  • 加入CSDN时间: 2017-02-25
博客简介:

ZHENG_ZE_KAI的博客

查看详细资料
  • 原力等级
    领奖
    当前等级
    0
    当前总分
    0
    当月
    0
个人成就
  • 获得0次点赞
  • 内容获得0次评论
  • 获得0次收藏
创作历程
  • 21篇
    2017年
成就勋章
创作活动更多

仓颉编程语言体验有奖征文

仓颉编程语言官网已上线,提供版本下载、在线运行、文档体验等功能。为鼓励更多开发者探索仓颉编程语言,现诚邀各位开发者通过官网在线体验/下载使用,参与仓颉体验有奖征文活动。

368人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

算法概论第八章部分习题解答

8.3 吝啬SAT问题是这样的:给定一组子句(每个子句都是其中文字的析取)和整数k,求一个最多有k各变量为true的满足赋值 —— 如果该赋值存在。证明吝啬SAT是NP完全问题。1.证明吝啬SAT是NP问题。2.证明吝啬SAT是NP完全问题。解:1.若存在一组对应于吝啬SAT问题子句变量的值,将这组值代入该问题中,可以在多项式时间内验证问题的解是否为真。因此吝啬SA
原创
发布博客 2017.07.14 ·
569 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example:For num
原创
发布博客 2017.06.19 ·
210 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Find Largest Value in Each Tree Row

You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]Solution
原创
发布博客 2017.06.19 ·
199 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Binary Search Tree Iterator

Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next()
原创
发布博客 2017.06.19 ·
192 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Linked List Random Node

Given a singly linked list, return a random node's value from the linked list. Each node must have thesame probability of being chosen.Follow up:What if the linked list is extremely large an
原创
发布博客 2017.06.19 ·
250 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Subarray Sum Equals K

Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals tok.Example 1:Input:nums = [1,1,1], k = 2Output: 2Note:
原创
发布博客 2017.06.19 ·
254 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Minimum Factorization

Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer is not fit in 32-bit signed integer, then r
原创
发布博客 2017.06.19 ·
369 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Minimum Height Trees

For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called
原创
发布博客 2017.06.19 ·
198 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Evaluate Division

Equations are given in the format A / B = k, where A andB are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the ans
原创
发布博客 2017.06.19 ·
205 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Assign Cookies

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a
原创
发布博客 2017.06.12 ·
194 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Range Sum Query - Mutable

Given an integer array nums, find the sum of the elements between indicesi and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at indexi to val.Examp
原创
发布博客 2017.06.12 ·
148 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Find Bottom Left Tree Value

Given a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2: Input: 1 / \ 2 3
原创
发布博客 2017.06.12 ·
161 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Merge Two Binary Trees

Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary
原创
发布博客 2017.06.12 ·
249 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with val
原创
发布博客 2017.06.12 ·
156 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Reverse Linked List

Reverse a singly linked list.Solution:/** * Definition for singly-linked list. * struct ListNode { *     int val; *     ListNode *next; *     ListNode(int x) : val(x), next(NULL) {}
原创
发布博客 2017.06.12 ·
141 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Minimum Absolute Difference in BST

Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example: Input: 1 \ 3 / 2Output:1Explanatio
原创
发布博客 2017.06.12 ·
178 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Intersection of Two Arrays

Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return[2]. Note:Each element in the result must be unique.The res
原创
发布博客 2017.06.12 ·
166 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Majority Element

Given an array of size n, find the majority element. The majority element is the element that appearsmore than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element
原创
发布博客 2017.03.16 ·
157 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Kth Largest Element in an Array

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return
原创
发布博客 2017.03.13 ·
165 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the
原创
发布博客 2017.03.07 ·
158 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多