2017.01.09:排序与搜索

本文介绍了几种常见的排序算法,包括合并排序、快速排序、堆排序、桶排序和基数排序,并讨论了快速选择算法及二分查找的基本原理。这些算法在计算机科学中具有广泛的应用。

排序和搜索

1.所谓的内排序是指所有的数据已经读入内存。在内存中进行排序的算法;同时,内排序也一般假定所有用到的辅助空间可以直接存在于内存中。与之对应,另一类排序称为外排序,即内存中无法保存全部数据,需要进行磁盘访问,每次读入部分数据到内存进行排序。

 

合并排序:利用分而治之的思想,对两部分非别进行排序,排序完成后,在将各自排序好的两个部分合并还原成一个有序结构;算法的时间复杂度为O(nlog n)。

 //合并函数
void Merge(int *_Array, int p, int q, int r) {// p:第0个;r:第n-1个数,q:第(r + p) / 2个数 
    int len1 = q - p + 1;
    int len2 = r - q;
    int *L = new int[len1 + 1];//用动态数组储存左边的数 
    int *R = new int[len2 + 1];//用动态数组储存右边的数 

    for (int i = 0; i < len1; i++) {// 把Array数组左边的数放入L数组 
        L[i] = _Array[p + i];
    }

    for (int j = 0; j < len2; j++) {// 把Array数组右边的数放入R数组 
        R[j] = _Array[q + 1 + j];
    }
    L[len1]=R[len2]=INT_MAX;    //定义无穷大 
    int i = 0, j = 0;
    for (int k = p; k <= r; k++) {
        if (L[i] < R[j]) {//小的放左边,大的放右边 
            _Array[k] = L[i];
            i++;
        }
        else {
            _Array[k] = R[j];
            j++;
        }
    }
}
//  归并排序
void MergeSort(int _Array[], int p, int r) {
    if (p < r) {//p:第0个;r:第n-1个数。数组至少要有两个数据 
        int q;
        q = (r + p) / 2;//拆分两组 
        MergeSort(_Array , p , q);//拆分第0个到第 (r + p) / 2个 ,即拆分左半部分 
        MergeSort(_Array , q+1 , r);//拆分第(r + p) / 2个到第r个 ,即拆分右半部分 
        Merge(_Array , p , q , r);//调用合并函数,从第0个到第n-1个排好 
    }
}

快速排序:随机选定一个元素作为轴值,利用该轴值将数据分为左右两个部分,左边元素都比轴值小,右边元素都比轴值大,但他们不是完全排序的,在此基础上,分别对左右两堆递归调用快速排序。算法的时间复杂度为O(nlog n),在最坏的情况下为O(n^2),额外空间复杂度O(log n)。


//快速排序
void quick_sort(int s[], int l, int r)
{
    if (l < r)
    {
		//Swap(s[l], s[(l + r) / 2]); //将中间的这个数和第一个数交换 参见注1
        int i = l, j = r, x = s[l];
        while (i < j)
        {
            while(i < j && s[j] >= x) // 从右向左找第一个小于x的数
				j--;  
            if(i < j) 
				s[i++] = s[j];
			
            while(i < j && s[i] < x) // 从左向右找第一个大于等于x的数
				i++;  
            if(i < j) 
				s[j--] = s[i];
        }
        s[i] = x;
        quick_sort(s, l, i - 1); // 递归调用 
        quick_sort(s, i + 1, r);
    }
}

堆排序:每次将剩余的最大元素移动到数组的最右边。算法的时间复杂度为O(nlog n),空间复杂度O(1)。

//堆排序函数
void HeapSort(int a[],int length)
{
    int temp;
    BuildMaxHeap(a,length);
    for (int i = length - 1; i >= 1; i--)
    {
        //交换根节点和数组的最后一个节点
        temp = a[i];
        a[i] = a[0];
        a[0] = temp;
        MaxHeapify(a, 0, 0, i-1);//维护从下标为i-1到0的子数组
    }
}

桶排序和基数排序:不需要进行数据之间的两辆比较,但是需要事先知道数组的一些具体情况。桶排序适用于知道待排序数组大小范围的情况,其特性在于将数据根据其大小,放入合适的桶中,再依次从桶中取出,形成有序序列。基数排序,进行了K次桶排序。

void radixsort(int data[], int n) //基数排序  
{  
    int d = maxbit(data, n);  
    int tmp[n];  
    int count[10]; //计数器  
    int i, j, k;  
    int radix = 1;  
    for(i = 1; i <= d; i++) //进行d次排序  
    {  
        for(j = 0; j < 10; j++)  
            count[j] = 0; //每次分配前清空计数器  
        for(j = 0; j < n; j++)  
        {  
            k = (data[j] / radix) % 10; //统计每个桶中的记录数  
            count[k]++;  
        }  
        for(j = 1; j < 10; j++)  
            count[j] = count[j - 1] + count[j]; //将tmp中的位置依次分配给每个桶  
        for(j = n - 1; j >= 0; j--) //将所有桶中记录依次收集到tmp中  
        {  
            k = (data[j] / radix) % 10;  
            tmp[count[k] - 1] = data[j];  
            count[k]--;  
        }  
        for(j = 0; j < n; j++) //将临时数组的内容复制到data中  
            data[j] = tmp[j];  
        radix = radix * 10;  
    }  
}  


快速选择算法:利用快速排序的思想,时间复杂度是O(n)。

二分查找:算法复杂度为O(logn)。

 int binarySearch(int *array, int left, int right, int value){
	 if(left>right){
		 return -1;
	 }
	 
	 int mid = right - (right - left)/2;
	 if(array[mid] == value){
		 return mid;
	 } else if(array[mid] < value){
		 return binarySearch(array,mid+1,right, value);
	 } else {
		 return binarySearch(array, left, mid-1, value);
	 }
 }




HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31099: 11-07 15:59:00.993 1759 3780 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31105: 11-07 15:59:00.998 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31107: 11-07 15:59:01.002 1759 3780 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31113: 11-07 15:59:01.015 1759 3780 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31119: 11-07 15:59:01.047 1759 12340 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31128: 11-07 15:59:01.077 1759 12340 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31134: 11-07 15:59:01.080 1759 12340 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31146: 11-07 15:59:01.116 1759 12340 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31153: 11-07 15:59:01.304 1759 1865 I ActivityManager: App 10228/com.shanbay.sentence targets O+, restricted 行 31155: 11-07 15:59:01.310 1759 3780 I ActivityManager: App 10228/com.shanbay.sentence targets O+, restricted 行 31157: 11-07 15:59:01.313 1759 12340 I ActivityManager: App 10228/com.shanbay.sentence targets O+, restricted 行 31159: 11-07 15:59:01.316 1759 3780 I ActivityManager: App 10228/com.shanbay.sentence targets O+, restricted 行 31161: 11-07 15:59:01.319 1759 12340 I ActivityManager: App 10228/com.shanbay.sentence targets O+, restricted 行 31163: 11-07 15:59:01.321 1759 3780 I ActivityManager: App 10228/com.shanbay.sentence targets O+, restricted 行 31165: 11-07 15:59:01.324 1759 12340 I BroadcastQueue: Finished with ordered [bgthirdapp] broadcast BroadcastRecord{7ec5393 u0 shanbay.appwidget.action.APPWIDGET_UPDATE} cost time 20,receiversNum 6,max receiver ResolveInfo{7c88fd0 com.shanbay.sentence/com.shanbay.biz.words.widget.provider.Goal4x2Provider m=0x108000} cost time 6 行 31167: 11-07 15:59:01.340 1759 1854 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31199: 11-07 15:59:01.601 1759 12340 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31204: 11-07 15:59:01.607 1759 3780 I MediaFocusControl: requestAudioFocus() from uid/pid 10228/29927 AA=USAGE_MEDIA/CONTENT_TYPE_MUSIC clientId=android.media.AudioManager@741e8bauw.a$a@f3bb650 callingPack=com.shanbay.sentence req=3 flags=0x2 sdk=30 targetStack=null zoneId-1 行 31207: 11-07 15:59:01.608 1759 3780 I HwMediaFocusControl: isRemoteApp: false, packageName: com.shanbay.sentence 行 31217: 11-07 15:59:01.608 1759 3780 I HwMediaFocusControl: isRemoteApp: false, packageName: com.shanbay.sentence 行 31223: 11-07 15:59:01.609 3427 3759 I PG_ash : com.shanbay.sentence BinderCallState: true, nextBinderCallTriggeringTime:83343368 行 31224: 11-07 15:59:01.609 3427 3514 I PGAudioState: audio focus pkg: com.shanbay.sentence last focus pkg : com.shanbay.sentence 行 31224: 11-07 15:59:01.609 3427 3514 I PGAudioState: audio focus pkg: com.shanbay.sentence last focus pkg : com.shanbay.sentence 行 31225: 11-07 15:59:01.609 3427 3514 I AppManager: audio focus pkg: com.shanbay.sentence 行 31240: 11-07 15:59:01.623 1759 3780 I HwOcrImeController: updateMultiWindow focus window = com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity mIsInMultiScreen = true 行 31259: 11-07 15:59:01.627 29927 29865 I ServiceUtilities: GetPackageNameByUid packages size is 1, packages[0] com.shanbay.sentence, uid(10228) 行 31261: 11-07 15:59:01.627 29927 29865 I ServiceUtilities: GetPackageNameByUid packages size is 1, packages[0] com.shanbay.sentence, uid(10228) 行 31267: 11-07 15:59:01.630 1375 1620 I CodecTracker: tId: 29865, pId: 29927, type: c2.android.mp3.decoder, pkgName: com.shanbay.sentence, mimeType: , width: , height: , frameRate: , macroblocks: , lifeCycle: UNINITIALIZED->INITIALIZING->INITIALIZED->CONFIGURING, scene: 行 31273: 11-07 15:59:01.631 1375 1620 I CodecTracker: tId: 29865, pId: 29927, type: c2.android.mp3.decoder, pkgName: com.shanbay.sentence, mimeType: , width: , height: , frameRate: , macroblocks: , lifeCycle: UNINITIALIZED->INITIALIZING->INITIALIZED->CONFIGURING->CONFIGURED, scene: 行 31275: 11-07 15:59:01.631 1375 2007 I CodecTracker: tId: 29865, pId: 29927, type: c2.android.mp3.decoder, pkgName: com.shanbay.sentence, mimeType: audio/raw, width: 0, height: 0, frameRate: 0, macroblocks: 0, lifeCycle: UNINITIALIZED->INITIALIZING->INITIALIZED->CONFIGURING->CONFIGURED, scene: 3 行 31278: 11-07 15:59:01.632 1375 1620 I CodecTracker: tId: 29865, pId: 29927, type: c2.android.mp3.decoder, pkgName: com.shanbay.sentence, mimeType: audio/raw, width: 0, height: 0, frameRate: 0, macroblocks: 0, lifeCycle: UNINITIALIZED->INITIALIZING->INITIALIZED->CONFIGURING->CONFIGURED->STARTING, scene: 3 行 31283: 11-07 15:59:01.636 1375 1620 I CodecTracker: tId: 29865, pId: 29927, type: c2.android.mp3.decoder, pkgName: com.shanbay.sentence, mimeType: audio/raw, width: 0, height: 0, frameRate: 0, macroblocks: 0, lifeCycle: UNINITIALIZED->INITIALIZING->INITIALIZED->CONFIGURING->CONFIGURED->STARTING->STARTED, scene: 3 行 31284: 11-07 15:59:01.637 3427 3514 I DeviceStateService: app: com.shanbay.sentence pid: 29927 start mediacodec. 行 31334: 11-07 15:59:01.656 1759 1831 I HwAudioService: getPackageNameByPid, packageName=com.shanbay.sentence 行 31365: 11-07 15:59:01.660 844 28832 I AudioAlgoService: setParameterToDsp: params is PLAYING_APP_NAME=[com.shanbay.sentence] 行 31405: 11-07 15:59:01.705 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31483: 11-07 15:59:01.732 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31526: 11-07 15:59:01.767 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31537: 11-07 15:59:01.804 1759 4649 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31540: 11-07 15:59:01.831 1759 3780 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31568: 11-07 15:59:02.210 1759 3161 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31584: 11-07 15:59:02.310 1759 3780 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31634: 11-07 15:59:02.729 1759 3780 I HwMediaFocusControl: isRemoteApp: false, packageName: com.shanbay.sentence 行 31640: 11-07 15:59:02.730 1759 3780 I HwMediaFocusControl: isRemoteApp: false, packageName: com.shanbay.sentence 行 31672: 11-07 15:59:02.836 1759 4649 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31717: 11-07 15:59:03.342 1759 4649 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31855: 11-07 15:59:03.848 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31859: 11-07 15:59:03.900 1759 3007 W 00202/hw_netstat: total/2130/43552,com.shanbay.sentence/2130/41602,com.huawei.hinote/0/1383,com.huawei.intelligent/0/352,com.huawei.hiaction.share_user:5514/0/215 行 31890: 11-07 15:59:04.357 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 31927: 11-07 15:59:04.605 3427 3920 I ThermalTraceService: code:1, appInfo:com.shanbay.sentence#10000, levelInfo:0,warm_system_h,2#26,warm_dot,1 行 31970: 11-07 15:59:04.870 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 32037: 11-07 15:59:05.379 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=true windowMode=100 行 32203: 11-07 15:59:05.567 1759 1842 I WindowManager: Changing focus from Window{58ba4d4 u0 com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity} to Window{9070d86 u0 com.huawei.hinote/com.huawei.hinote.edit.EditActivity} displayId=0 行 32249: 11-07 15:59:05.576 1759 1842 W HwActivityTaskManagerServiceEx: appSwitch from: com.shanbay.sentence to: com.huawei.hinote 行 32252: 11-07 15:59:05.577 29927 29927 I TopResumedActivityChangeItem: execute start, ActivityClientRecord = ActivityRecord{8c17465 token=android.os.BinderProxy@3b36ced {com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity}} 行 32275: 11-07 15:59:05.582 3427 3514 I ScenarioService: app focus change from: com.shanbay.sentence to:com.huawei.hinote 行 32320: 11-07 15:59:05.594 3193 5686 I CapsuleManager: onAppSwitch package=com.huawei.hinote, current=com.shanbay.sentence 行 32434: 11-07 15:59:05.616 1759 3787 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 32499: 11-07 15:59:05.624 3586 4712 I {AssistantService-13.9.1.300}_AssistantApkNotifier: registerHwActivityNotifier call fromPackage:com.shanbay.sentence, toPackage:com.huawei.hinote 行 32500: 11-07 15:59:05.624 1759 1854 I SWAP_Scene: Entering notifySceneData notifySceneData. EventType:APP_SWITCH_FROM pkg:com.shanbay.sentence uid:10228 pid:0 proc: activity:null 行 32577: 11-07 15:59:05.637 3586 3752 I NetPredictEngine: Parent: active app change, old packageName: com.shanbay.sentence, new packageName: com.huawei.hinote 行 32622: 11-07 15:59:05.646 1759 15446 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 32623: Queue: [com.huawei.hwstartupguide, com.huawei.iconnect.ui, com.huawei.stylus.floatmenu, tv.danmaku.bilibilihd, com.quark.browser, com.huawei.browser, com.ss.android.ugc.aweme, com.tencent.mm, com.huawei.notepad, com.android.settings, com.huawei.phoneservice, com.shanbay.sentence, com.huawei.hinote] 行 32639: 11-07 15:59:05.650 1759 4234 I SWAP_AK : BG com.shanbay.sentence M 行 32752: 11-07 15:59:05.689 3427 3514 I ScenarioService: refresh visibleApp:[com.huawei.hinote, com.shanbay.sentence] 行 32799: 11-07 15:59:05.699 3427 3514 I ScenarioService: multiScreenVisibleApps: 0:com.huawei.hinote#com.shanbay.sentence:10188#10228 行 32800: 11-07 15:59:05.699 3427 3514 I PGServer: report state:15 event type:1 pid:-1 uid:-1 pkg:0:com.huawei.hinote#com.shanbay.sentence:10188#10228 to pid: 3427 行 33169: 11-07 15:59:05.897 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33228: 11-07 15:59:05.925 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33259: 11-07 15:59:05.945 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33274: 11-07 15:59:05.964 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33434: 11-07 15:59:06.059 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33446: 11-07 15:59:06.077 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33454: 11-07 15:59:06.079 1759 1854 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33456: 11-07 15:59:06.081 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33474: 11-07 15:59:06.112 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33476: 11-07 15:59:06.114 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33478: 11-07 15:59:06.117 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33595: 11-07 15:59:06.229 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33613: 11-07 15:59:06.232 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33731: 11-07 15:59:06.285 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33757: 11-07 15:59:06.292 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 33986: 11-07 15:59:06.449 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34017: 11-07 15:59:06.491 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34021: 11-07 15:59:06.493 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34053: 11-07 15:59:06.512 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34060: 11-07 15:59:06.517 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34136: 11-07 15:59:06.618 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34138: 11-07 15:59:06.620 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34191: 11-07 15:59:06.664 1759 13865 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34210: 11-07 15:59:06.677 1759 1831 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34465: 11-07 15:59:06.966 1759 2016 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34638: 11-07 15:59:07.063 1759 2017 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 34681: 11-07 15:59:07.079 1759 4653 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 35263: 11-07 15:59:07.267 588 588 I lowmemorykiller: Kill 'com.shanbay.sentence' (29927), uid 10228, oom_score_adj 102 to free 291240kB rss, 328664kb swap 行 35301: 11-07 15:59:07.280 588 588 I lowmemorykiller: Kill 'com.shanbay.sentence:pushcore' (22647), uid 10228, oom_score_adj 102 to free 74832kB rss, 225304kb swap 行 35312: 11-07 15:59:07.287 1759 3282 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 35355: 11-07 15:59:07.303 1759 3282 I HwActivityTaskManagerServiceEx: add visible task, topActivity=com.shanbay.sentence/com.shanbay.bay.biz.words.v2.study.StudyActivity taskId=990 isVisible=true isFocused=false windowMode=100 行 36135: 11-07 15:59:07.963 1759 3013 I ConnectivityService: releasing NetworkRequest [ REQUEST id=1377, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10228 RequestorUid: 10228 RequestorPkg: com.shanbay.sentence] ] (release request) 行 36179: 11-07 15:59:08.027 3427 3759 I ash_trans: com.shanbay.sentence { running duration=2006220 Uptime=2006219 } transition to: end, reason: not_running 行 36180: 11-07 15:59:08.028 3427 3759 I PG_ash : delete app record pkg: com.shanbay.sentence 根据日志给我分析一下com.shanbay.sentence被杀的原因是什么,不要分析什么可能是啥问题,给我直接问题和解决方案
最新发布
11-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值