Skip to content

Commit 7a0bf93

Browse files
committed
Improve heap, add priority queue, add heap sort
1 parent f4be92e commit 7a0bf93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3584
-309
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,398 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
7B1BFA451C69158D0051C9A4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1BFA441C69158D0051C9A4 /* AppDelegate.swift */; };
11+
7B1BFA471C69158D0051C9A4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7B1BFA461C69158D0051C9A4 /* Assets.xcassets */; };
12+
7B1BFA4A1C69158D0051C9A4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B1BFA481C69158D0051C9A4 /* MainMenu.xib */; };
13+
7B1BFA551C69158D0051C9A4 /* HeapSortTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1BFA541C69158D0051C9A4 /* HeapSortTests.swift */; };
14+
7B1BFA601C69159D0051C9A4 /* HeapSort.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1BFA5F1C69159D0051C9A4 /* HeapSort.swift */; };
15+
7B1BFA621C6915A70051C9A4 /* Heap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1BFA611C6915A70051C9A4 /* Heap.swift */; };
16+
/* End PBXBuildFile section */
17+
18+
/* Begin PBXContainerItemProxy section */
19+
7B1BFA511C69158D0051C9A4 /* PBXContainerItemProxy */ = {
20+
isa = PBXContainerItemProxy;
21+
containerPortal = 7B1BFA391C69158D0051C9A4 /* Project object */;
22+
proxyType = 1;
23+
remoteGlobalIDString = 7B1BFA401C69158D0051C9A4;
24+
remoteInfo = HeapSort;
25+
};
26+
/* End PBXContainerItemProxy section */
27+
28+
/* Begin PBXFileReference section */
29+
7B1BFA411C69158D0051C9A4 /* HeapSort.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HeapSort.app; sourceTree = BUILT_PRODUCTS_DIR; };
30+
7B1BFA441C69158D0051C9A4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
31+
7B1BFA461C69158D0051C9A4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
32+
7B1BFA491C69158D0051C9A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
33+
7B1BFA4B1C69158D0051C9A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
34+
7B1BFA501C69158D0051C9A4 /* HeapSortTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HeapSortTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
35+
7B1BFA541C69158D0051C9A4 /* HeapSortTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeapSortTests.swift; sourceTree = "<group>"; };
36+
7B1BFA561C69158D0051C9A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
37+
7B1BFA5F1C69159D0051C9A4 /* HeapSort.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeapSort.swift; path = ../../HeapSort.swift; sourceTree = "<group>"; };
38+
7B1BFA611C6915A70051C9A4 /* Heap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Heap.swift; path = ../../../Heap/Heap.swift; sourceTree = "<group>"; };
39+
/* End PBXFileReference section */
40+
41+
/* Begin PBXFrameworksBuildPhase section */
42+
7B1BFA3E1C69158D0051C9A4 /* Frameworks */ = {
43+
isa = PBXFrameworksBuildPhase;
44+
buildActionMask = 2147483647;
45+
files = (
46+
);
47+
runOnlyForDeploymentPostprocessing = 0;
48+
};
49+
7B1BFA4D1C69158D0051C9A4 /* Frameworks */ = {
50+
isa = PBXFrameworksBuildPhase;
51+
buildActionMask = 2147483647;
52+
files = (
53+
);
54+
runOnlyForDeploymentPostprocessing = 0;
55+
};
56+
/* End PBXFrameworksBuildPhase section */
57+
58+
/* Begin PBXGroup section */
59+
7B1BFA381C69158D0051C9A4 = {
60+
isa = PBXGroup;
61+
children = (
62+
7B1BFA431C69158D0051C9A4 /* HeapSort */,
63+
7B1BFA531C69158D0051C9A4 /* HeapSortTests */,
64+
7B1BFA421C69158D0051C9A4 /* Products */,
65+
);
66+
sourceTree = "<group>";
67+
};
68+
7B1BFA421C69158D0051C9A4 /* Products */ = {
69+
isa = PBXGroup;
70+
children = (
71+
7B1BFA411C69158D0051C9A4 /* HeapSort.app */,
72+
7B1BFA501C69158D0051C9A4 /* HeapSortTests.xctest */,
73+
);
74+
name = Products;
75+
sourceTree = "<group>";
76+
};
77+
7B1BFA431C69158D0051C9A4 /* HeapSort */ = {
78+
isa = PBXGroup;
79+
children = (
80+
7B1BFA441C69158D0051C9A4 /* AppDelegate.swift */,
81+
7B1BFA461C69158D0051C9A4 /* Assets.xcassets */,
82+
7B1BFA611C6915A70051C9A4 /* Heap.swift */,
83+
7B1BFA5F1C69159D0051C9A4 /* HeapSort.swift */,
84+
7B1BFA4B1C69158D0051C9A4 /* Info.plist */,
85+
7B1BFA481C69158D0051C9A4 /* MainMenu.xib */,
86+
);
87+
path = HeapSort;
88+
sourceTree = "<group>";
89+
};
90+
7B1BFA531C69158D0051C9A4 /* HeapSortTests */ = {
91+
isa = PBXGroup;
92+
children = (
93+
7B1BFA541C69158D0051C9A4 /* HeapSortTests.swift */,
94+
7B1BFA561C69158D0051C9A4 /* Info.plist */,
95+
);
96+
path = HeapSortTests;
97+
sourceTree = "<group>";
98+
};
99+
/* End PBXGroup section */
100+
101+
/* Begin PBXNativeTarget section */
102+
7B1BFA401C69158D0051C9A4 /* HeapSort */ = {
103+
isa = PBXNativeTarget;
104+
buildConfigurationList = 7B1BFA591C69158D0051C9A4 /* Build configuration list for PBXNativeTarget "HeapSort" */;
105+
buildPhases = (
106+
7B1BFA3D1C69158D0051C9A4 /* Sources */,
107+
7B1BFA3E1C69158D0051C9A4 /* Frameworks */,
108+
7B1BFA3F1C69158D0051C9A4 /* Resources */,
109+
);
110+
buildRules = (
111+
);
112+
dependencies = (
113+
);
114+
name = HeapSort;
115+
productName = HeapSort;
116+
productReference = 7B1BFA411C69158D0051C9A4 /* HeapSort.app */;
117+
productType = "com.apple.product-type.application";
118+
};
119+
7B1BFA4F1C69158D0051C9A4 /* HeapSortTests */ = {
120+
isa = PBXNativeTarget;
121+
buildConfigurationList = 7B1BFA5C1C69158D0051C9A4 /* Build configuration list for PBXNativeTarget "HeapSortTests" */;
122+
buildPhases = (
123+
7B1BFA4C1C69158D0051C9A4 /* Sources */,
124+
7B1BFA4D1C69158D0051C9A4 /* Frameworks */,
125+
7B1BFA4E1C69158D0051C9A4 /* Resources */,
126+
);
127+
buildRules = (
128+
);
129+
dependencies = (
130+
7B1BFA521C69158D0051C9A4 /* PBXTargetDependency */,
131+
);
132+
name = HeapSortTests;
133+
productName = HeapSortTests;
134+
productReference = 7B1BFA501C69158D0051C9A4 /* HeapSortTests.xctest */;
135+
productType = "com.apple.product-type.bundle.unit-test";
136+
};
137+
/* End PBXNativeTarget section */
138+
139+
/* Begin PBXProject section */
140+
7B1BFA391C69158D0051C9A4 /* Project object */ = {
141+
isa = PBXProject;
142+
attributes = {
143+
LastSwiftUpdateCheck = 0720;
144+
LastUpgradeCheck = 0720;
145+
ORGANIZATIONNAME = "Swift Algorithm Club";
146+
TargetAttributes = {
147+
7B1BFA401C69158D0051C9A4 = {
148+
CreatedOnToolsVersion = 7.2;
149+
};
150+
7B1BFA4F1C69158D0051C9A4 = {
151+
CreatedOnToolsVersion = 7.2;
152+
TestTargetID = 7B1BFA401C69158D0051C9A4;
153+
};
154+
};
155+
};
156+
buildConfigurationList = 7B1BFA3C1C69158D0051C9A4 /* Build configuration list for PBXProject "HeapSort" */;
157+
compatibilityVersion = "Xcode 3.2";
158+
developmentRegion = English;
159+
hasScannedForEncodings = 0;
160+
knownRegions = (
161+
en,
162+
Base,
163+
);
164+
mainGroup = 7B1BFA381C69158D0051C9A4;
165+
productRefGroup = 7B1BFA421C69158D0051C9A4 /* Products */;
166+
projectDirPath = "";
167+
projectRoot = "";
168+
targets = (
169+
7B1BFA401C69158D0051C9A4 /* HeapSort */,
170+
7B1BFA4F1C69158D0051C9A4 /* HeapSortTests */,
171+
);
172+
};
173+
/* End PBXProject section */
174+
175+
/* Begin PBXResourcesBuildPhase section */
176+
7B1BFA3F1C69158D0051C9A4 /* Resources */ = {
177+
isa = PBXResourcesBuildPhase;
178+
buildActionMask = 2147483647;
179+
files = (
180+
7B1BFA471C69158D0051C9A4 /* Assets.xcassets in Resources */,
181+
7B1BFA4A1C69158D0051C9A4 /* MainMenu.xib in Resources */,
182+
);
183+
runOnlyForDeploymentPostprocessing = 0;
184+
};
185+
7B1BFA4E1C69158D0051C9A4 /* Resources */ = {
186+
isa = PBXResourcesBuildPhase;
187+
buildActionMask = 2147483647;
188+
files = (
189+
);
190+
runOnlyForDeploymentPostprocessing = 0;
191+
};
192+
/* End PBXResourcesBuildPhase section */
193+
194+
/* Begin PBXSourcesBuildPhase section */
195+
7B1BFA3D1C69158D0051C9A4 /* Sources */ = {
196+
isa = PBXSourcesBuildPhase;
197+
buildActionMask = 2147483647;
198+
files = (
199+
7B1BFA621C6915A70051C9A4 /* Heap.swift in Sources */,
200+
7B1BFA451C69158D0051C9A4 /* AppDelegate.swift in Sources */,
201+
7B1BFA601C69159D0051C9A4 /* HeapSort.swift in Sources */,
202+
);
203+
runOnlyForDeploymentPostprocessing = 0;
204+
};
205+
7B1BFA4C1C69158D0051C9A4 /* Sources */ = {
206+
isa = PBXSourcesBuildPhase;
207+
buildActionMask = 2147483647;
208+
files = (
209+
7B1BFA551C69158D0051C9A4 /* HeapSortTests.swift in Sources */,
210+
);
211+
runOnlyForDeploymentPostprocessing = 0;
212+
};
213+
/* End PBXSourcesBuildPhase section */
214+
215+
/* Begin PBXTargetDependency section */
216+
7B1BFA521C69158D0051C9A4 /* PBXTargetDependency */ = {
217+
isa = PBXTargetDependency;
218+
target = 7B1BFA401C69158D0051C9A4 /* HeapSort */;
219+
targetProxy = 7B1BFA511C69158D0051C9A4 /* PBXContainerItemProxy */;
220+
};
221+
/* End PBXTargetDependency section */
222+
223+
/* Begin PBXVariantGroup section */
224+
7B1BFA481C69158D0051C9A4 /* MainMenu.xib */ = {
225+
isa = PBXVariantGroup;
226+
children = (
227+
7B1BFA491C69158D0051C9A4 /* Base */,
228+
);
229+
name = MainMenu.xib;
230+
sourceTree = "<group>";
231+
};
232+
/* End PBXVariantGroup section */
233+
234+
/* Begin XCBuildConfiguration section */
235+
7B1BFA571C69158D0051C9A4 /* Debug */ = {
236+
isa = XCBuildConfiguration;
237+
buildSettings = {
238+
ALWAYS_SEARCH_USER_PATHS = NO;
239+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240+
CLANG_CXX_LIBRARY = "libc++";
241+
CLANG_ENABLE_MODULES = YES;
242+
CLANG_ENABLE_OBJC_ARC = YES;
243+
CLANG_WARN_BOOL_CONVERSION = YES;
244+
CLANG_WARN_CONSTANT_CONVERSION = YES;
245+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
246+
CLANG_WARN_EMPTY_BODY = YES;
247+
CLANG_WARN_ENUM_CONVERSION = YES;
248+
CLANG_WARN_INT_CONVERSION = YES;
249+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
250+
CLANG_WARN_UNREACHABLE_CODE = YES;
251+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
252+
CODE_SIGN_IDENTITY = "-";
253+
COPY_PHASE_STRIP = NO;
254+
DEBUG_INFORMATION_FORMAT = dwarf;
255+
ENABLE_STRICT_OBJC_MSGSEND = YES;
256+
ENABLE_TESTABILITY = YES;
257+
GCC_C_LANGUAGE_STANDARD = gnu99;
258+
GCC_DYNAMIC_NO_PIC = NO;
259+
GCC_NO_COMMON_BLOCKS = YES;
260+
GCC_OPTIMIZATION_LEVEL = 0;
261+
GCC_PREPROCESSOR_DEFINITIONS = (
262+
"DEBUG=1",
263+
"$(inherited)",
264+
);
265+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
266+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
267+
GCC_WARN_UNDECLARED_SELECTOR = YES;
268+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
269+
GCC_WARN_UNUSED_FUNCTION = YES;
270+
GCC_WARN_UNUSED_VARIABLE = YES;
271+
MACOSX_DEPLOYMENT_TARGET = 10.11;
272+
MTL_ENABLE_DEBUG_INFO = YES;
273+
ONLY_ACTIVE_ARCH = YES;
274+
SDKROOT = macosx;
275+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
276+
};
277+
name = Debug;
278+
};
279+
7B1BFA581C69158D0051C9A4 /* Release */ = {
280+
isa = XCBuildConfiguration;
281+
buildSettings = {
282+
ALWAYS_SEARCH_USER_PATHS = NO;
283+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
284+
CLANG_CXX_LIBRARY = "libc++";
285+
CLANG_ENABLE_MODULES = YES;
286+
CLANG_ENABLE_OBJC_ARC = YES;
287+
CLANG_WARN_BOOL_CONVERSION = YES;
288+
CLANG_WARN_CONSTANT_CONVERSION = YES;
289+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
290+
CLANG_WARN_EMPTY_BODY = YES;
291+
CLANG_WARN_ENUM_CONVERSION = YES;
292+
CLANG_WARN_INT_CONVERSION = YES;
293+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
294+
CLANG_WARN_UNREACHABLE_CODE = YES;
295+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
296+
CODE_SIGN_IDENTITY = "-";
297+
COPY_PHASE_STRIP = NO;
298+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
299+
ENABLE_NS_ASSERTIONS = NO;
300+
ENABLE_STRICT_OBJC_MSGSEND = YES;
301+
GCC_C_LANGUAGE_STANDARD = gnu99;
302+
GCC_NO_COMMON_BLOCKS = YES;
303+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
304+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
305+
GCC_WARN_UNDECLARED_SELECTOR = YES;
306+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
307+
GCC_WARN_UNUSED_FUNCTION = YES;
308+
GCC_WARN_UNUSED_VARIABLE = YES;
309+
MACOSX_DEPLOYMENT_TARGET = 10.11;
310+
MTL_ENABLE_DEBUG_INFO = NO;
311+
SDKROOT = macosx;
312+
};
313+
name = Release;
314+
};
315+
7B1BFA5A1C69158D0051C9A4 /* Debug */ = {
316+
isa = XCBuildConfiguration;
317+
buildSettings = {
318+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
319+
COMBINE_HIDPI_IMAGES = YES;
320+
INFOPLIST_FILE = HeapSort/Info.plist;
321+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
322+
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.HeapSort;
323+
PRODUCT_NAME = "$(TARGET_NAME)";
324+
};
325+
name = Debug;
326+
};
327+
7B1BFA5B1C69158D0051C9A4 /* Release */ = {
328+
isa = XCBuildConfiguration;
329+
buildSettings = {
330+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
331+
COMBINE_HIDPI_IMAGES = YES;
332+
INFOPLIST_FILE = HeapSort/Info.plist;
333+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
334+
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.HeapSort;
335+
PRODUCT_NAME = "$(TARGET_NAME)";
336+
};
337+
name = Release;
338+
};
339+
7B1BFA5D1C69158D0051C9A4 /* Debug */ = {
340+
isa = XCBuildConfiguration;
341+
buildSettings = {
342+
BUNDLE_LOADER = "$(TEST_HOST)";
343+
COMBINE_HIDPI_IMAGES = YES;
344+
INFOPLIST_FILE = HeapSortTests/Info.plist;
345+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
346+
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.HeapSortTests;
347+
PRODUCT_NAME = "$(TARGET_NAME)";
348+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HeapSort.app/Contents/MacOS/HeapSort";
349+
};
350+
name = Debug;
351+
};
352+
7B1BFA5E1C69158D0051C9A4 /* Release */ = {
353+
isa = XCBuildConfiguration;
354+
buildSettings = {
355+
BUNDLE_LOADER = "$(TEST_HOST)";
356+
COMBINE_HIDPI_IMAGES = YES;
357+
INFOPLIST_FILE = HeapSortTests/Info.plist;
358+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
359+
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.HeapSortTests;
360+
PRODUCT_NAME = "$(TARGET_NAME)";
361+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HeapSort.app/Contents/MacOS/HeapSort";
362+
};
363+
name = Release;
364+
};
365+
/* End XCBuildConfiguration section */
366+
367+
/* Begin XCConfigurationList section */
368+
7B1BFA3C1C69158D0051C9A4 /* Build configuration list for PBXProject "HeapSort" */ = {
369+
isa = XCConfigurationList;
370+
buildConfigurations = (
371+
7B1BFA571C69158D0051C9A4 /* Debug */,
372+
7B1BFA581C69158D0051C9A4 /* Release */,
373+
);
374+
defaultConfigurationIsVisible = 0;
375+
defaultConfigurationName = Release;
376+
};
377+
7B1BFA591C69158D0051C9A4 /* Build configuration list for PBXNativeTarget "HeapSort" */ = {
378+
isa = XCConfigurationList;
379+
buildConfigurations = (
380+
7B1BFA5A1C69158D0051C9A4 /* Debug */,
381+
7B1BFA5B1C69158D0051C9A4 /* Release */,
382+
);
383+
defaultConfigurationIsVisible = 0;
384+
defaultConfigurationName = Release;
385+
};
386+
7B1BFA5C1C69158D0051C9A4 /* Build configuration list for PBXNativeTarget "HeapSortTests" */ = {
387+
isa = XCConfigurationList;
388+
buildConfigurations = (
389+
7B1BFA5D1C69158D0051C9A4 /* Debug */,
390+
7B1BFA5E1C69158D0051C9A4 /* Release */,
391+
);
392+
defaultConfigurationIsVisible = 0;
393+
defaultConfigurationName = Release;
394+
};
395+
/* End XCConfigurationList section */
396+
};
397+
rootObject = 7B1BFA391C69158D0051C9A4 /* Project object */;
398+
}

0 commit comments

Comments
 (0)