NOTE FOR PTA WEEK(小题)
来源:互联网 发布:淘宝女鞋店铺介绍范文 编辑:程序博客网 时间:2024/06/13 13:44
WEEK2
判断
1-1 For a sequentially stored linear list of length N, the time complexities for deleting the first element and inserting the last element are O(1) and O(N), respectively. (1分)
T F
key:false,删除的时候需要先遍历找到这个结点,所以应该是O(N)的时间复杂度,插入要遍历到最后一个结点,也是O(N)
1-2 If a linear list is represented by a linked list, the addresses of the elements in the memory must be consecutive.
T F
key:false,链表的存储地址不连续。
ps:linear list和linked list 区别,linear list是一种数据结构,线性表中数据元素之间的关系是一对一的关系,即除了第一个和最后一个数据元素之外,其它数据元素都是首尾相接的。linear list一般有两种实现形式,一种是数组(Array),一种是链表(Linked list)。一般认为线性表中数据存储是在一块连续的存储空间之中,而链表的存储可以是分散的,下一地址储存在节点之中。
WEEK4
选择
2-2
Given a tree of degree 4. Suppose that the numbers of nodes of degrees 1, 2, 3 and 4 are 4, 2, 1 and 1, respectively. Then the number of leaf nodes must be: (3分)
- 4
- 6
- 8
- 10
If a binary search tree of N nodes is complete, which one of the following statements is FALSE? (1分)
- the average search time for all nodes is O(logN)
- the minimum key must be at a leaf node
- the maximum key must be at a leaf node
- the median node must either be the root or in the left subtree
A strongly connected graph with N vertices must have at least __ edges. (2分)
- N−1
- N
- N+1
- N(N−1)
If graph G is NOT connected and has 28 edges, then it must have at least __ vertices. (3分)
- 7
- 8
- 9
- 10
In a directed graph, the sum of in- and out-degrees of all the vertices is __ times the number of edges. (2分)
- 1/2
- 1
- 2
- 4
If quick sort is implemented recursively to sort an array of records, then which one of the following statements is TRUE? (2分)
- After each partition, handling the longer sublist first will reduce the number of recursions.
- After each partition, handling the shorter sublist first will reduce the number of recursions.
- The number of recursions has nothing to do with the order of handling the sublists after each partition.
- The number of recursions has nothing to do with the initial condition of the input.
- NOTE FOR PTA WEEK(小题)
- Machine Learning week 1 note
- Machine Learning week 3 note
- Coursera-MachineLearning Note-Week 5
- C#小技巧——Note for C#入门经典
- Plan for this week
- Google: MapReduce in a Week Note
- Machine Learning week 1 note cont.
- Machine Learning week 3 note cont.
- Coursera Machine Learning Note - Week 1
- Coursera Machine Learning Note - Week 2
- Coursera Machine Learning Note - Week 3
- 数据结构选择题判断题(PTA)
- Plan for the next week
- the aim for next week
- leetcode Plan For This Week
- First note for testing
- note for tty
- 表单,单行文本框,密码框,单选框,列表框(下拉列表),浏览框,隐藏域,多行文本框,图像按钮,提交按钮,重置按钮,普通按钮
- jsp中的日期显示问题
- Dubbo学习
- java成神之路
- java8-汇总数组总的值及可变参数
- NOTE FOR PTA WEEK(小题)
- jQuery_可见性过滤选择器
- 没有在2016年当过前端程序员的设计师不是好产品经理
- sicily 最短距离 期末测试
- maven 光速入门攻略05
- ZooKeeper应用场景
- CSS干货系列(三)字体
- swift 请小心使用你的get方法,should be a descendant of reference view
- 设计模式(八)——桥接模式