by fox64194167
Stack1.h #ifndef stack_ #define stack_ #include "stdafx.h" //#include <iostream> //using namespace std; //exception class OutOfBounds{ public: OutOfBounds(){} }; //change array's size template<class T> void Changesize1D(T * &arr,const int& size,const int& ToSize){ T* tmp = new T[size]; tmp = arr; arr = new T[ToSize]; for(int i=0; i< size; ++i){ arr[ […]
by fox64194167
In this problem we are to match the left and right parentheses in a character string. For example, the string (a*(b+c)+d) has left parentheses at positions 0 and 3 and right parentheses at positions 7 and 10. The left parenthesis at position 0 matches the right at position 10, while the left parenthesis at position 3 matches the right parenthesis at position 7. In the string (a+b))(, the right par […]
by fox64194167
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <!– The layout_gravity example –> <LinearLayout android:layout_width="fill_parent" an […]
by fox64194167
Heaps Heap Definition A max tree(min tree) is a tree in which the value in each node is greater(less) than or equal to those in its children(if any) Building a max heap Look at below figure, we adjust elements in a array, swap some elements, at last we have a max heap. The progress begin from the last smallest heap. If it is a illegal max heap, we swap elements […]
by fox64194167
What is a face normal? A face normal is a vector that describes the direction a polygon is facing(see figure 1) Figure 1: The face normal of a surface What is a vertex normal? Vertex normal have some relationships with face normal. We will discuss it in “How to calculate face normal and vertex normal?” Sometimes we can set vertex normal just as same as face […]