算法(第四版) 1.3答案
2016-09-06 15:37
316 查看
<strong>1.3.1</strong>
public boolean isFull() { return N == a.length(); }1.3.2
was best the of times was it the
1.3.3
a √ b × c√d√e√f×g×h√
1.3.4
<span style="white-space:pre"> </span>public boolean checkMatch(Item item)//这个方法是在stack类中实现的 { Item tmp = pop(); if(tmp == (Character)'[' && item == (Character)']') return true; if(tmp == (Character)'(' && item ==(Character) ')') return true; if(tmp == (Character)'{' && item == (Character)'}') return true; return false; } public static void main(String[] args) { Stack<Character> stack = new Stack<Character>(); String input; input = StdIn.readString(); for(int i = 0;i<input.length();i++) { char tmp = input.charAt(i); if(tmp == '[' || tmp == '(' || tmp == '{') stack.push(tmp); else if(tmp == ']' || tmp == ')' || tmp == '}') if(stack.checkMatch(tmp)) continue; else { StdOut.println("false"); return; } else { StdOut.println("bad input"); return; } } StdOut.println("true"); }1.3.5 除二逆序取余
1.3.6 将队列中的数字逆序
1.3.7
public Item peek() { return first.item; }1.3.8 1 it
1.3.9
1.3.13 b、c和d
1.3.14
public class FixedCapacityQueue<Item> { private Item[] a; private int N; private int head;//删除在队头 private int tail;//插入在队尾 public FixedCapacityQueue(int capacity) { a = (Item[]) new Object[capacity]; N = 0; head = -1; tail = -1; } public boolean isEmpty() { return N == 0; } public boolean isFull() { return N == a.length; } public int size() { return N; } private int indexPlus(int num) { if(++num == a.length) return 0; else return num; } public void enQueue(Item item) { if(isFull()) StdOut.println("Queue is full"); else { N++; tail = indexPlus(tail); a[tail] = item; } } public Item deQueue() { if(isEmpty()) { StdOut.println("Queue is empty"); return null; } else { N--; head = indexPlus(head); Item item = a[head]; a[head] = null; return item; } } public static void main(String[] args) { // TODO Auto-generated method stub FixedCapacityQueue<Integer> queue = new FixedCapacityQueue<Integer>(10); queue.deQueue(); for(int i = 0;i<11;i++) queue.enQueue(i); for(int i =0;i<10;i++) StdOut.println(queue.deQueue()); } }
public class ResizeArrayQueue<Item> { private Item[] a = (Item[])new Object[1]; private int N=0; private int head = -1; private int tail = -1; public ResizeArrayQueue() { N = 0; head = -1; tail = -1; } public boolean isEmpty() { return N == 0; } public boolean isFull() { return N == a.length; } public int size() { return N; } private void resize(int capacity)//most { Item[] tmp = (Item[]) new Object[capacity]; int tmpHead = -1; int tmpTail = -1; for(int i = 0;i<N;i++) { if(++tmpTail == tmp.length) tmpTail = 0; if(++head == a.length) head = 0; tmp[tmpTail] = a[head]; } a = tmp; head = tmpHead; tail = tmpTail; } private int indexPlus(int num) { if(++num==a.length) return 0; else return num; } public void enQueue(Item item) { if(isFull()) resize(2 * N); tail = indexPlus(tail); a[tail] = item; N++; } public Item deQueue() { if(isEmpty()) { StdOut.println("queue is empty"); return null; } else { N--; head = indexPlus(head); Item item = a[head]; a[head] = null; if(N == a.length/4) resize(a.length/2); return item; } } public static void main(String[] args) { // TODO Auto-generated method stub ResizeArrayQueue<Integer> queue = new ResizeArrayQueue<Integer>(); for(int i = 0;i<10;i++) { queue.enQueue(i); //StdOut.println(queue.size()); } for(int i= 0;i<10;i++) StdOut.println(queue.deQueue()); } }
1.3.15
public static void main(String[] args) { // TODO Auto-generated method stub ResizeArrayQueue<String> queue = new ResizeArrayQueue<String>(); while(!StdIn.isEmpty()) { queue.enQueue(StdIn.readString()); } int N = Integer.parseInt(args[0]); int size = queue.size(); for(int i =0;i<(size-N);i++) queue.deQueue(); StdOut.println(queue.deQueue()); }
1.3.16
public static Date[] readDates() { ResizeArrayQueue<Date> queue = new ResizeArrayQueue<Date>(); while(!StdIn.isEmpty()) { int m = StdIn.readInt(); int d = StdIn.readInt(); int y = StdIn.readInt(); Date tmp = new Date(m,d,y); queue.enQueue(tmp); } int size= queue.size(); Date[] result = new Date[size]; for(int i = 0;i<size;i++) { result[i] = queue.deQueue(); } return result; }1.3.17方法同上
链表练习
1.3.19
public static List deleteEnd(List first) { <span style="white-space:pre"> </span>if(first == null) return null; <span style="white-space:pre"> </span>if(first.next == null) first=null; <span style="white-space:pre"> </span>else <span style="white-space:pre"> </span>{ <span style="white-space:pre"> </span>List current = first; <span style="white-space:pre"> </span>while(current.next.next != null) current = current.next; <span style="white-space:pre"> </span>current.next = null; <span style="white-space:pre"> </span>} <span style="white-space:pre"> </span>return first; }
1.3.20
public static List delete(List first,int k) { <span style="white-space:pre"> </span>if(first == null) return null; <span style="white-space:pre"> </span>if(k == 1) first = first.next; <span style="white-space:pre"> </span>k = k - 1; <span style="white-space:pre"> </span>List current = first; <span style="white-space:pre"> </span>while(--k>0 && current.next !=null) <span style="white-space:pre"> </span>current = current.next; <span style="white-space:pre"> </span>if(k == 0&¤t.next != null) <span style="white-space:pre"> </span>current.next = current.next.next; <span style="white-space:pre"> </span>return first; }1.3.21
public static boolean find(List first,String key) { <span style="white-space:pre"> </span>while(first !=null) <span style="white-space:pre"> </span>{ <span style="white-space:pre"> </span>if(first.item == key) return true; <span style="white-space:pre"> </span>first = first.next; <span style="white-space:pre"> </span>} <span style="white-space:pre"> </span>return false; }1.3.24
public static void removeAfter(List node) { <span style="white-space:pre"> </span>if(node == null || node.next == null) return; <span style="white-space:pre"> </span>node.next = node.next.next; }1.3.25
public static void insertAfter(List node1,List node2) <span style="white-space:pre"> </span>{ <span style="white-space:pre"> </span>if(node1 == null || node2 == null) return; <span style="white-space:pre"> </span>List tmp = node1.next; <span style="white-space:pre"> </span>node1.next = node2; <span style="white-space:pre"> </span>node2.next = tmp; <span style="white-space:pre"> </span>}1.3.26
<span style="white-space:pre"> </span>public static List remove(List first,String key) { if(first == null) return null; if(first.next == null && first.item == key) return null; else if(first.next == null) return first; List current = first; while(current.next.next != null) { if(current.next.item == key) { current.next = current.next.next; continue; } current = current.next; } if(current.next.item == key) current.next = null; if(first.item == key) first = first.next; return first; }1.3.27
public static int max(List first) { int most = 0; if(first == null) return 0; while(first != null) { if((int)(first.item) > most) most =(int)first.item; first = first.next; } return most; }
1.3.28
<span style="white-space:pre"> </span>public static int max(int a, int b) { if(a>=b) return a; else return b; } public static int maxDigui(List first) { if(first == null) return 0; return max(maxDigui(first.next),(int)first.item); }
1.3.29
public class CircleQueue<Item> { private class Node { Item item; Node next; } //private Node head; private Node last; private int N; public boolean isEmpty() { return N == 0; } public int size() { return N; } public void enQueue(Item item) { Node oldLast = last; last = new Node(); last.item = item; if(isEmpty()) last.next = last; else { last.next = oldLast.next; oldLast.next = last; } N++; } public Item deQueue() { Item item = last.next.item; N--; if(isEm e6c2 pty()) last =null; else { last.next = last.next.next; } return item; } public static void main(String[] args) { // TODO Auto-generated method stub CircleQueue<Integer> queue = new CircleQueue<Integer>(); for(int i = 0;i<10;i++) queue.enQueue(i); for(int i = 0;i<10;i++) StdOut.println(queue.deQueue()); } }1.3.31
public class DoubleNode<Item> { private class Node { public Item item; public Node next = this; public Node privious = this; public Node(Item data) { item = data; } } private int size; private Node head = new Node(null); public void addFirst(Item data) { Node newNode = new Node(data); newNode.next = head.next; newNode.privious = head; head.next = newNode; newNode.next.privious = newNode; size++; } public void addLast(Item data) { Node newNode = new Node(data); newNode.next = head; newNode.privious = head.privious; head.privious = newNode; newNode.privious.next = newNode; size++; } public void removeFirst() { head.next = head.next.next; head.next.next.privious = head; size--; } public void removeLast() { head.privious = head.privious.privious; head.privious.privious.next = head; size--; } public void insertAfter(Item data,Node x) { Node newNode = new Node(data); newNode.next = x.next; newNode.privious = x; x.next = newNode; newNode.next.privious = newNode; size++; } public void insertBefore(Item data,Node x) { Node newNode = new Node(data); newNode.next = x; newNode.privious = x.privious; x.privious = newNode; newNode.privious.next = newNode; size++; } public void delete(Node x) { x.privious.next = x.next; x.next.privious = x.privious; size--; } public void printAll() { Node current = head.next; for(int i = 0;i<size;i++) { StdOut.println(current.item); current = current.next; } } public static void main(String[] args) { // TODO Auto-generated method stub DoubleNode<String> head = new DoubleNode<String>(); head.addLast("q"); head.addLast("w"); head.addFirst("e"); head.addFirst("r"); head.printAll(); } }
1.3.32
public class Steque<Item> { private class Node { Item item; Node next; } private int size; private Node head; private Node tail; public boolean isEmpty() { return size == 0; } public int size() { return size; } public void push(Item data)//对head进行操作 { Node oldHead = head; head = new Node(); head.item = data; if(isEmpty()) tail = head; else head.next = oldHead; size++; } public Item pop() { Item item = head.item; head = head.next; size--; if(isEmpty()) tail = null; return item; } public void enqueue(Item data) { Node oldTail = tail; tail = new Node(); tail.item = data; if(isEmpty()) head= tail; else oldTail.next = tail; size++; } public void printAll() { Node current = head; while(size-->0) { StdOut.println(current.item); current = current.next; } } public static void main(String[] args) { // TODO Auto-generated method stub Steque<Integer> stq = new Steque<Integer>(); stq.push(1); stq.push(2); stq.push(3); stq.enqueue(4); stq.enqueue(5); stq.pop(); stq.pop(); stq.printAll(); } }
<strong>1.3.33</strong>
import java.util.Iterator; public class Deque<Item> implements Iterable<Item> { private class Node { public Node next = this; public Node previous = this; public Item item; public Node(Item data) { item = data; } } private Node last = new Node(null); private int size; public boolean isEmpty() { return size == 0; } public int size() { return size; } public void pushleft(Item data)//在前面 { Node newNode = new Node(data); newNode.previous = last; newNode.next = last.next; last.next = newNode; newNode.next.previous = newNode; size++; } public Item popleft() { Item ret = last.next.item; last.next = last.next.next; last.next.next.previous = last; size--; return ret; } public void pushRight(Item data) { Node newNode = new Node(data); newNode.next= last; newNode.previous = last.previous; last.previous = newNode; newNode.previous.next = newNode; size++; } public Item popRight() { Item ret = last.previous.item; last.previous = last.previous.previous; last.previous.previous.next = last; size--; return ret; } public void printAll() { Node current = last.next; int N = size; while(size>0) { StdOut.println(current.item); current = current.next; size--; } } public Iterator<Item> iterator() { return new ListIterator(); } private class ListIterator implements Iterator<Item> { private int N = size; private Node current = last.next; public boolean hasNext() { return N>0; } public void remove() {} public Item next() { Item item = current.item; current= current.next; return item; } } public static void main(String[] args) { // TODO Auto-generated method stub Deque<Integer> deque = new Deque<Integer>(); deque.pushleft(1); deque.pushleft(2); deque.pushRight(3); deque.pushRight(4); deque.printAll(); } }
public class ResizingArrayDeque<Item> { private int head=-1; private int tail=-1; private int size; Item[] a= (Item[])new Object[1]; public boolean isEmpty() { return size == 0; } public int size() { return size; } public void resize(int cap)// { Item[] tmp = (Item[]) new Object[cap]; int newHead= 0; int newTail = -1; for(int i = 0;i<size;i++) { if(++newTail >= a.length) newTail = 0; tmp[newTail] = a[head]; if(++head >= a.length) head = 0; } a = tmp; head = newHead; tail = newTail; } public void pushLeft(Item data) { if(size == a.length) resize(2*size); if(--head<0) head = a.length-1; a[head] = data; //StdOut.println(a[0]); size++; } public Item popLeft() { Item item = a[head]; //StdOut.println(head); if(++head == a.length) head = 0; size--; if(size == a.length/4) resize(a.length/2); return item; } public void pushRight(Item data) { if(size == a.length) resize(2*size); if(++tail == a.length) tail = 0; a[tail] = data; size++; } public Item popRight() { Item item = a[tail]; if(++tail == a.length) tail = 0; size--; if(size == a.length/4) resize(a.length/2); return item; } public static void main(String[] args) { // TODO Auto-generated method stub ResizingArrayDeque<Integer> dqueue = new ResizingArrayDeque<Integer>(); dqueue.pushLeft(1); dqueue.pushLeft(2); dqueue.pushLeft(3); StdOut.println(dqueue.popLeft()); StdOut.println(dqueue.popLeft()); StdOut.println(dqueue.popLeft()); dqueue.pushRight(1); dqueue.pushRight(2); dqueue.pushRight(3); StdOut.println(dqueue.popLeft()); StdOut.println(dqueue.popLeft()); StdOut.println(dqueue.popLeft()); } }1.3.34
</pre><p></p><p></p><pre name="code" class="java">import java.util.Iterator; public class RandomBag<Item> implements Iterable<Item> { private Item[] a = (Item[]) new Object[1]; int size; public boolean isEmpty() { return size == 0; } public int size() { return size; } private void resize(int cap) { Item[] tmp = (Item[]) new Object[cap]; for(int i = 0;i<size;i++) tmp[i] = a[i]; a=tmp; } public void add(Item item) { if(size == a.length) resize(2*size); a[size++] = item; } public Iterator<Item> iterator() { return new RandomIterator(); } private int[] randomInt(int N) { int[] tmp = new int ; for(int i =0;i<N;i++) tmp[i] = i; for(int i = N ;i>0;i--) { int index = StdRandom.uniform(i); int temp = tmp[index]; tmp[index] = tmp[i-1]; tmp[i-1] = temp; } return tmp; } private class RandomIterator implements Iterator<Item> { int[] randomArray = randomInt(size); int N = size; public boolean hasNext() { return size>0; } public void remove(){} public Item next() { return a[randomArray[--size]]; } } public static void main(String[] args) { // TODO Auto-generated method stub RandomBag<Integer> rdmBag = new RandomBag<Integer>(); rdmBag.add(1); rdmBag.add(2); rdmBag.add(3); rdmBag.add(4); for(int i : rdmBag) StdOut.println(i); } }1.3.35
public class RandomQueue<Item> { private Item[] a = (Item[]) new Object[1]; private int N; public boolean isEmpty() { return N == 0; } public int size() { return N; } private void resize(int cap) { Item[] tmp = (Item[]) new Object[cap]; for(int i = 0; i<N; i++) tmp[i] = a[i]; a = tmp; //StdOut.print(" "+cap+" "); } public void enqueue(Item item) { if(N == a.length) resize(2*a.length); a[N++] = item; } public Item dequeue() { int index = StdRandom.uniform(N); Item indexTmp = a[index]; a[index] = a[N-1]; a[N-1] = indexTmp; Item tmp = a[--N]; a = null; if( N == a.length/4) resize(a.length/2); return tmp; } public Item sample() { int index = StdRandom.uniform(N); return a[index]; } public Iterator<Item> iterator() { return new ReverseIterator(); } private class ReverseIterator implements Iterator<Item> { private int i = N; public boolean hasNext() { return N>0; } public void remove(){} public Item next() { return a[--i]; } } public static void main(String[] args) { // TODO Auto-generated method stub RandomQueue<Integer> queue = new RandomQueue<Integer>(); queue.enqueue(1); queue.enqueue(2); queue.enqueue(3); StdOut.println(queue.sample()); StdOut.println(queue.sample()); StdOut.println(queue.sample()); } }
1.3.36
import java.util.Iterator; public class RandomQueue<Item> implements Iterable<Item> { private Item[] a = (Item[]) new Object[1]; private int N; public boolean isEmpty() { return N == 0; } public int size() { return N; } private void resize(int cap) { Item[] tmp = (Item[]) new Object[cap]; for(int i = 0; i<N; i++) tmp[i] = a[i]; a = tmp; //StdOut.print(" "+cap+" "); } public void enqueue(Item item) { if(N == a.length) resize(2*a.length); a[N++] = item; } public Item dequeue() { int index = StdRandom.uniform(N); Item indexTmp = a[index]; a[index] = a[N-1]; a[N-1] = indexTmp; Item tmp = a[--N]; a = null; if( N == a.length/4) resize(a.length/2); return tmp; } public Item sample() { int index = StdRandom.uniform(N); return a[index]; } public Iterator<Item> iterator() { return new RandomIterator(); } private int[] randomInt(int N) { int[] tmp = new int ; for(int i =0;i<N;i++) tmp[i] = i; for(int i = N ;i>0;i--) { int index = StdRandom.uniform(i); int temp = tmp[index]; tmp[index] = tmp[i-1]; tmp[i-1] = temp; } return tmp; } private class RandomIterator implements Iterator<Item> { int[] randomArray = randomInt(N); int size = N; public boolean hasNext() { return size>0; } public void remove(){} public Item next() { return a[randomArray[--size]]; } } public static void main(String[] args) { // TODO Auto-generated method stub RandomQueue<Integer> queue = new RandomQueue<Integer>(); queue.enqueue(1); queue.enqueue(2); queue.enqueue(3); queue.enqueue(4); queue.enqueue(5); queue.enqueue(6); for(int i : queue) StdOut.println(i); } }
1.3.37
public static void main(String[] args) { // TODO Auto-generated method stub ResizeArrayQueue<Integer> queue = new ResizeArrayQueue<Integer>(); int N = StdIn.readInt(); int M = StdIn.readInt(); int[] tmp = new int ; for(int i = 0;i<N;i++) { queue.enQueue(i); } for(int i = N;i>0;i--) { for(int j = 0;j<M-1;j++) { int d = queue.deQueue(); queue.enQueue(d); } StdOut.println(queue.deQueue()); } }1.3.38
public class GeneralizedQueue<Item> { private Item[] a = (Item[]) new Object[1]; private int size; public int size() { return size; } private void resize(int cap) { Item[] tmp = (Item[]) new Object[cap]; for(int i = 0;i<size;i++) tmp[i] = a[i]; a = tmp; } public void insert(Item item) { if(size == a.length) resize(2*size); a[size++] = item; } public Item delete(int k) { if(k>=size) { StdOut.println("delete k error"); return null; } Item ret = a[k-1]; for(int j = k;j<size;j++) a[j-1] = a[j]; a[size-1] = null; size--; if(size == a.length/4) resize(a.length/2); return ret; } public void printAll() { for(int i =0;i<size;i++) StdOut.println(a[i]); } public static void main(String[] args) { // TODO Auto-generated method stub GeneralizedQueue<Integer> queue = new GeneralizedQueue<Integer>(); for(int i = 0;i<10;i++) queue.insert(i); queue.delete(1); queue.delete(3); queue.printAll(); } }
public class GeneralizedListQueue<Item> { private class List { List next; Item item; List(Item data) { item = data; next = null; } } private List head = new List(null); private int size; public boolean isEmpty() { return size == 0; } public void insert(Item x) { List current = head; while(current.next != null) current = current.next; current.next = new List(x); size++; } public Item delete(int k) { if(k>size) { StdOut.println("k >= size"); return null; } else { List current = head; while( --k > 0 ) current = current.next; Item item = current.next.item; current.next = current.next.next; size--; return item; } } public void printAll() { List current = head; while(current.next != null) { current = current.next; StdOut.println(current.item); } } public static void main(String[] args) { // TODO Auto-generated method stub GeneralizedListQueue<Integer> queue = new GeneralizedListQueue<Integer>(); queue.insert(1); queue.insert(2); queue.insert(3); queue.delete(3); queue.printAll(); } }
1.3.39
public class RingBuffer<Item> { private Item[] a; private int size; private int head = 0; private int tail = -1; public RingBuffer(int cap) { a = (Item[]) new Object[cap]; } public boolean isEmpty() { return size == 0; } public int size() { return size; } public void enqueue(Item item) { ++tail; if(tail == a.length) tail = 0; a[tail] = item; size++; } public Item dequeue() { Item item = a[head++]; if(head == a.length) head = 0; size--; return item; } public static void main(String[] args) { // TODO Auto-generated method stub RingBuffer<Integer> queue = new RingBuffer<Integer>(10); for(int i = 0;i<10;i++) queue.enqueue(i); for(int i = 0;i<10;i++) StdOut.println(queue.dequeue()); } }
1.3.40
public class GeneralizedListQueue<Item> { private class List { List next; Item item; List(Item data) { item = data; next = null; } } private List head = new List(null); private int size; public boolean isEmpty() { return size == 0; } public void insert(Item x) { List tmp = head.next; head.next = new List(x); head.next.next = tmp; size++; } public boolean delete(Item x) { //StdOut.println(x); List current = head; while( current.next != null && !current.next.item.equals(x) ) current = current.next; if(current.next != null) { current.next = current.next.next; size--; return true; } return false; } public void printAll() { List current = head; while(current.next != null) { current = current.next; StdOut.println(current.item); } } public static void main(String[] args) { // TODO Auto-generated method stub GeneralizedListQueue<String> queue = new GeneralizedListQueue<String>(); String[] input; input = StdIn.readAllStrings(); for(int i = 0;i<input.length;i++) { queue.delete(input[i]); queue.insert(input[i]); } queue.printAll(); } }1.3.41
<strong> </strong>public RingBuffer(RingBuffer old) { a = (Item[]) new Object[old.size()]; int N = old.size; for(int i = 0;i<N; i++) { Item tmp =(Item)old.dequeue(); enqueue(tmp); old.enqueue(tmp); } }
1.3.42
<strong> </strong>public Stack(Stack old) { Stack tmp = new Stack(); for(int i = 0;i<old.size();i++) tmp.push(old.pop()); for(int i = 0;i<old.size();i++) { Item x =(Item) tmp.pop(); old.push(x); push(x); } }1.3.43
import java.io.File; import java.util.ArrayList; import java.util.Arrays; public class FileList { public static void getAllFileName(String path,ResizeArrayQueue<String> fileName,int index) { File file = new File(path); File [] files = file.listFiles(); String [] names = file.list(); if(names != null) { int num = index; String s=""; while(num-->0) s+=" "; for(int i = 0;i<names.length;i++) fileName.enQueue(s+names[i]); } index++; for(File a:files) { if(a.isDirectory()) { getAllFileName(a.getAbsolutePath(),fileName,index); } } } public static void main(String[] args) { // TODO Auto-generated method stub ResizeArrayQueue<String> filename = new ResizeArrayQueue<String>(); getAllFileName("G:\\测试",filename,0); int N = filename.size(); for(int i = 0;i<N;i++) System.out.println(filename.deQueue()); } }
1.3.44
public class Buffer
{
private int cur;
private int size;
private ResizeArrayStack<Character> stack;
public Buffer()
{
stack = new ResizeArrayStack<Character>();
}
public void left(int k)
{
if(cur-k>=0) cur -= k;
}
public void right(int k)
{
if(cur+k<=size) cur+=k;
}
public int size()
{
return size;
}
public void insert(char c)
{
ResizeArrayStack<Character> tmp = new ResizeArrayStack<Character>();
for(int i =0;i<size - cur;i++)
tmp.push(stack.pop());
stack.push(c);
for(int i =0;i<size - cur;i++)
stack.push(tmp.pop());
size++;
}
public void delete()
{
ResizeArrayStack<Character> tmp = new ResizeArrayStack<Character>();
for(int i =0;i<size - cur;i++)
tmp.push(stack.pop());
tmp.pop();
for(int i =0;i<size - cur-1;i++)
stack.push(tmp.pop());
size--;
if(cur>size) cur=size;
}
public void printAll()
{
for(char c:stack)
StdOut.println(c);
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
Buffer buf = new Buffer();
buf.insert('a');
buf.insert('b');
buf.insert('c');
buf.insert('d');
buf.right(2);
buf.insert('f');
buf.printAll();
}
}1.3.45
相关文章推荐
- 网上一些《算法(第四版)》习题答案链接
- 算法第四版 课后习题答案
- 算法(第四版) 2.1答案
- 《算法(第四版)》 1.3.12
- 算法-第四版-1.3 背包、队列和栈-习题索引汇总
- 【算法第四版】2.5.2练习题答案 组合词输出
- 算法(第四版 Robert Sedgewick)课后练习答案 1.1 基础编程模型
- 算法(第四版)答案 1.5案例研究
- 算法 第四版 习题 答案 笔记 1.1
- 算法(第四版) chapter 1.1部分习题答案
- 算法-第四版-1.3 背包、队列和栈-习题索引汇总
- 算法-第四版-1.3.14答案
- 算法第四版练习题答案
- 算法第四版练习题答案
- 算法第四版练习题答案
- 算法-第四版-练习1.3.26解答
- 算法-第四版-练习1.3.10解答
- 算法-第四版-练习1.2.17解答
- 算法-第四版-练习1.2.1解答
- C+++Primer课后题答案 第四版