MCPcopy Create free account
hub / github.com/AdvancedCompiler/AdvancedCompiler / main

Function main

code/Chapter8/8-23.c:4–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <stdio.h>
3#define NUM_KEYS 8
4int main() {
5 int i,key;
6 int key_array[NUM_KEYS];
7 int bucket_ptrs[NUM_KEYS];
8 int key_buff2[NUM_KEYS];
9 int shift = 1;
10 for (i = 0; i < NUM_KEYS; i++) {
11 key_array[i] = i;
12 bucket_ptrs[i] = i;
13 key_buff2[i] = 0;
14 }
15 for (i = 0; i < NUM_KEYS; i++) {
16 key = key_array[i];
17 key_buff2[bucket_ptrs[key >> shift]++] = key;
18 }
19 for (i = 0; i < NUM_KEYS; i++) {
20 printf("%d ", key_buff2[i]);
21 }
22}
23//片断2:指针链表
24#include <stdio.h>
25#include<stdlib.h>

Callers

nothing calls this directly

Calls 3

initLinkFunction · 0.85
displayFunction · 0.85
selectElemFunction · 0.85

Tested by

no test coverage detected