File f=new File("a.MP4");
File f1=new File("a.avl");
try {
if(f1.exists()==false)
f1.createNewFile();
FileInputStream fi=new FileInputStream(f);
FileOutputStream fo=new FileOutputStream(f1);
byte b[]=new byte[1024];
int l=0,i=1;
fo.write(b,0,l);
System.out.println("have copied "+i+"kb");
i++;
}
System.out.println("finished");
fo.close();
fi.close();

2个回答

huangkang66 回复caozhy: 好的3q

huangkang66 谢谢，我刚学文件io，正好碰到想转换视频格式就试了试，没想到只是实现了复制而已哈哈，请问java视频的转码需要用到什么包什么类呢

AVL Tree
Problem Description An AVL tree is a kind of balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Addition and deletion operations also take O(logn) time. Definition of an AVL tree An AVL tree is a binary search tree which has the following properties: 1. The sub-trees of every node differ in height by at most one. 2. Every sub-tree is an AVL tree. Balance requirement for an AVL tree: the left and right sub-trees differ by at most 1 in height.An AVL tree of n nodes can have different height. For example, n = 7: So the maximal height of the AVL Tree with 7 nodes is 3. Given n,the number of vertices, you are to calculate the maximal hight of the AVL tree with n nodes. Input Input file contains multiple test cases. Each line of the input is an integer n(0<n<=10^9). A line with a zero ends the input. Output An integer each line representing the maximal height of the AVL tree with n nodes. Sample Input 1 2 0 Sample Output 0 1

AVL树的问题
[img]http://dl.iteye.com/upload/attachment/560359/31f73803-30b7-37b7-a343-0646dd6c4d9b.jpg[/img] 在看AVL树的时候遇到个问题：节点的平衡因子是它的右子树的高度减去它的左子树的高度。带有平衡因子 1、0 或 -1 的节点被认为是平衡的。带有平衡因子 -2 或 2 的节点被认为是不平衡的。 不太理解这句话。 以上图为例，我认为的是：15的左子树的高度是1，右子树的高度也是1，1-1应该等于0啊，怎么等于2呢。。。 求解答。
AVL数据结构上的平衡树的高度的计算方式，怎么采用C语言的办法对这个问题的实现？
Problem Description An AVL tree is a kind of balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Addition and deletion operations also take O(logn) time. Definition of an AVL tree An AVL tree is a binary search tree which has the following properties: 1. The sub-trees of every node differ in height by at most one. 2. Every sub-tree is an AVL tree. Balance requirement for an AVL tree: the left and right sub-trees differ by at most 1 in height.An AVL tree of n nodes can have different height. For example, n = 7: So the maximal height of the AVL Tree with 7 nodes is 3. Given n,the number of vertices, you are to calculate the maximal hight of the AVL tree with n nodes. Input Input file contains multiple test cases. Each line of the input is an integer n(0<n<=10^9). A line with a zero ends the input. Output An integer each line representing the maximal height of the AVL tree with n nodes. Sample Input 1 2 0 Sample Output 0 1

Problem Description An AVL tree is a kind of balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Addition and deletion operations also take O(logn) time. Definition of an AVL tree An AVL tree is a binary search tree which has the following properties: 1. The sub-trees of every node differ in height by at most one. 2. Every sub-tree is an AVL tree. Balance requirement for an AVL tree: the left and right sub-trees differ by at most 1 in height.An AVL tree of n nodes can have different height. For example, n = 7: So the maximal height of the AVL Tree with 7 nodes is 3. Given n,the number of vertices, you are to calculate the maximal hight of the AVL tree with n nodes. Input Input file contains multiple test cases. Each line of the input is an integer n(0<n<=10^9). A line with a zero ends the input. Output An integer each line representing the maximal height of the AVL tree with n nodes. Sample Input 1 2 0 Sample Output 0 1
AVL单旋转问题（简单的C++指针）

[新手程序员]Avl树旋转代码问题
bool BiNode::LR_Balance(BiNode** T) { BiNode* tempNode = (*T)->lchild->rchild; BiNode* p = (*T)->lchild; if (tempNode == NULL) return false; /* 处理tempNode的子树 */ (*T)->lchild->rchild = tempNode->lchild; (*T)->lchild = tempNode->rchild; /* 将子树根节点和根节点的有节点连接掉tempNode */ tempNode->lchild = p; tempNode->rchild = (*T); (*T) = tempNode;//改变了T的父节点的孩子指针的指向，从指向T变成指向tempNode return true; } (*T) = tempNode; 逐行运行时发现这一行代码使T的父节点指T的指针变成了指向tempNode当前节点。 然后我又写了下面的程序，结果并没有改变。 int main() { BiNode* BST1= new BiNode(); BiNode* BST2 = new BiNode(); BiNode* BST3 = new BiNode(); bool change(BiNode** T); BST1->data = 59; BST2->data = 33; BST3->data = 13; BST1->lchild = BST2; change(&BST2); BST1->PreOrderTraverse(BST); cout << endl; } bool change(BiNode** T) { BiNode* BST3 = new BiNode(); BST3->data = 13; (*T) = BST3; return true; } 二级指针能不能这么用？如果可以，后面那个为什么不行？ 如果不行，二级指针是用来做什么的 。 如果二级指针能这么用，该怎么理解？ 一般说指针指向地址，可以理解为指向一个固定的内存单元吗，这个内存单元的地址也是固定的。只有这样假设我才能想明白第一个程序为什么有效果

AVL树是指左右子树的高度差不超过1,现在有一颗n个节点的 AVL树，问这样的树有多少种，比如n=10,有60种。

``` void Cstree::deleteuser(string na) { while (!path.empty()) { path.pop(); } bool flag; Cnode* t; Cnode* parent; deletehelp(na, flag, t, parent); if (!flag) //没有找到要删除的用户 { cout << "用户名不存在，删除失败！" << endl; getchar(); return; } if (t->left != NULL && t->right != NULL) //要删除的节点有左右节点 { Cnode* temp = t->right; parent = t; while (temp->left != NULL) { path.push(temp); parent = temp; temp = temp->left; } t->name = temp->name; //交换被删节点与其后继节点的用户名与密码 t->password = temp->password; t = temp; } Cnode* childtree = t->left; //指向t的子树的指针 if (childtree == NULL) { childtree = t->right; //若左节点不存在，则指向右节点（右节点也可能为NULL） } if (parent == NULL) //删除的是根节点 { root = childtree; } else if (parent->left == t) //若t是parent的左节点 { parent->left = childtree; //则parent的左指针指向childtree } else //若t是parent的右节点 { parent->right = childtree; //则parent的右指针指向childtree } string username = t->name; delete t; while (!(path.empty())) //删除完成，修改平衡因子，旋转 { Cnode* location = path.top(); //从删除位置开始，逐层向上修改平衡因子，需要弹出栈中元素 if (username > location->name) //删除的是左子树中的节点 { (location->balanceFactor)++; } else if (username < location->name) //删除的是右子树中的节点 { (location->balanceFactor)--; } int bF = location->balanceFactor; //修改后的平衡因子 path.pop(); //删除栈顶元素 if (bF != 0) { if (bF == 1 || bF == -1) //平衡因子为1或-1时说明删除后的树还是平衡的，不需要旋转 { return; } else if (bF == 2 || bF == -2) //如果为2或-2，则进行旋转 { rotation(bF, location); } } } cout << "删除成功!" << endl; getchar(); } ``` ``` void Cstree::deletehelp(string name, bool &flag, Cnode* &location, Cnode* &parent) { location = root; parent = NULL; flag = false; while (!flag && location != NULL) { if (name < location->name) { path.push(location); parent = location; location = location->left; } else if (location->name < name) { path.push(location); parent = location; location = location->right; } else //找到要删除的节点 { flag = true; } } } ```

AVL树是指左右子树的高度差不超过1，现在有一颗n个节点的AVL树，问这样的树有多少种。比如n为10，答案为60种，时间效率要求尽量高。

avl是一棵平衡树。 有一个avl<person>的变量，person类里有name，phone两个变量。现在知道了name，怎么找到phone。

5个结点的AVL树,其不同形态个数为多少种？，，，，，，，，，，，

Problem Description An AVL tree is a kind of balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Addition and deletion operations also take O(logn) time. Definition of an AVL tree An AVL tree is a binary search tree which has the following properties: 1. The sub-trees of every node differ in height by at most one. 2. Every sub-tree is an AVL tree. Balance requirement for an AVL tree: the left and right sub-trees differ by at most 1 in height.An AVL tree of n nodes can have different height. For example, n = 7: So the maximal height of the AVL Tree with 7 nodes is 3. Given n,the number of vertices, you are to calculate the maximal hight of the AVL tree with n nodes. Input Input file contains multiple test cases. Each line of the input is an integer n(0<n<=10^9). A line with a zero ends the input. Output An integer each line representing the maximal height of the AVL tree with n nodes. Sample Input 1 2 0 Sample Output 0 1

Java学习的正确打开方式

Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）

HashMap 相关概念 HashTab、HashMap、TreeMap 均以键值对像是存储或操作数据元素。HashTab继承自Dictionary，HashMap、TreeMap继承自AbstractMap，三者均实现Map接口 **HashTab：**同步哈希表，不支持null键或值，因为同步导致性能影响，很少被使用 **HashMap：**应用较多的非同步哈希表，支持null键或值，是键值对...

linux系列之常用运维命令整理笔录

Python 基础（一）：入门必备知识

Python十大装B语法
Python 是一种代表简单思想的语言，其语法相对简单，很容易上手。不过，如果就此小视 Python 语法的精妙和深邃，那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点，并附上详细的实例代码。如能在实战中融会贯通、灵活使用，必将使代码更为精炼、高效，同时也会极大提升代码B格，使之看上去更老练，读起来更优雅。 1. for - else 什么？不是 if 和 else 才

2019年11月中国大陆编程语言排行榜
2019年11月2日，我统计了某招聘网站，获得有效程序员招聘数据9万条。针对招聘信息，提取编程语言关键字，并统计如下： 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7

JDK12 Collectors.teeing 你真的需要了解一下

“狗屁不通文章生成器”登顶GitHub热榜，分分钟写出万字形式主义大作

《程序人生》系列-这个程序员只用了20行代码就拿了冠军

11月8日，由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办，科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。 　　区块链技术被认为是继蒸汽机、电力、互联网之后，下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力，电力解决了人类基本的生活需求，互联网彻底改变了信息传递的方式，区块链作为构造信任的技术有重要的价值。 　　1...