- 博客(18)
- 收藏
- 关注
原创 COMP0005-Notes(7): Balanced Search Trees
Contents2-3 Search TreeStructureAssociated MethodsGet(Search)Put(Insert)AnalysisRed-Black Binary Search Tree2-3 Search TreeStructureA 2-3 search tree follows the basic construction of a tree, with a minor difference being that it has two types of nodes:
2022-02-20 05:03:49
347
原创 COMP0004-Notes(8): Interface
ContentsAs a concept & a Java keywordKEYWORD - InterfaceKEYWORD - implementsUMLInterface referencesKEYWORD - defaultKEYWORD - staticDeclaring variables in interfacesAs a concept & a Java keywordIn Java and OOP as a whole, there are two traditiona
2022-02-19 01:25:15
372
原创 COMP0004-Notes(7): Inheritance
ContentsKEYWORD - extendsAttributes InheritanceKEYWORD - superKEYWORD - protectedMethods InheritanceKEYWORD - abstractDirect inheritanceOverridingSuperclass referencesDynamic BindingStatic BindingPurpose of doing this...Remove duplicationGeneric codepublic
2022-02-12 20:33:57
366
原创 COMP0004-Notes(6): Static
ContentsStatic VariablesStatic MethodsStatic VariablesClass variables… one copy held across all instance objects.Can be used for:Class Constants (e.g. public static double PI)Count the number of objects created (e.g. private static int count gets inc
2022-02-09 02:26:56
278
原创 COMP0004-Notes(4): Use Case
ContentsWhat is a Use case?ActorsScenariosRepresenting a Use caseTextualTitlePrimary ActorScenarioOptional FieldsGraphical / UML Use Case DiagramImportant NotesStick To Requirements!Problems With Choice of WordingActorsLevel of DetailMiscellaneousWhat is
2022-02-08 22:52:09
198
原创 COMP0004-Notes(5): Requirements
ContentsSyntax of a requirementRequirement TypesFunctionalNon-functionalRequirement PrioritiesImportant NotesSyntax of a requirementRequirement TypesFunctionalNon-functionalRequirement PrioritiesMoSCoWImportant Notes
2022-02-08 22:51:33
290
原创 COMP0005-Notes(6): Binary Search Trees (BST)
ContentsStructureAssociated MethodsGet(Search)PseudocodePut(Insert)Main IdeaPseudocodeImplementation ExplainedFloorCeilingDelete MinimumMain IdeaPseudocodeImplementation ExplainedDeleteMain IdeaStructureBase case1: Null is a tree.Base case2: A single no
2022-02-08 08:10:31
92
原创 COMP0005-Notes(5): Heap Sort
ContentsHeapBinary HeapNormal Binary TreeBinary HeapEnqueue()Dequeue()Heap SortMain IdeaAnalysisComplexityBenefitsDrawbacksHeapHeap can occur in many forms. If it can be treated as a linear queue, where each element is associated with a priority value. T
2022-01-31 09:36:54
398
原创 COMP0005-Notes(4): Quick Sort
ContentsMain IdeaAnalysisComplexityBenefitsDrawbacksPossible fixMain IdeaRandomly shuffle the input array onceChoose a pivot from the array and insert it into the “correct” position - where all elements to the left are smaller and all elements to the r
2022-01-27 09:04:14
141
原创 COMP0004-Notes(3): UML
ContentsModelsWhat are models?Purpose of models?Abstraction & ReificationAbstractionReificationUnified Modelling Language (UML)Standard UMLJava ImplementationModelsWhat are models?Representation of a system in the form of notations or a languageMod
2022-01-27 08:08:15
200
原创 COMP0005-Notes(3): Merge Sort
ContentsMain IdeaDividingMerging(Conquering)Primitive & Time-wastingImprovedComplexityMemoryStabilityMain IdeaDividingIdea that each length-1 array is inherently sortedMerging(Conquering)Idea of merging two pre-sorted sub-arrays by always compa
2022-01-24 05:52:30
164
原创 COMP0005-Notes(2): Selection sort & Insertion sort
ContentsSelection SortMain IdeaInvariantsComplexityInsertion SortMain IdeaInvariantsComplexitySelection SortMain IdeaScan the array from the left to the right of the array;n iterations;in each iteration i (0 <= i <= n-1), find the index min of
2022-01-24 03:28:25
546
原创 COMP0005-Notes(1): Abstract Data Types(ADTs)
ContentsCircular queuesInitialising a circular queueInserting first elementAdding (Inserting) more elementsDeleting an elementCircular queuesThe core idea of a circular queue is that the pointer of the tail should directly point to the head.Initialising
2022-01-23 19:40:40
180
原创 COMP0004-Notes(2): Principles of Java Programming
ContentsAbstractionLess Distinctions, More Commonality!RepresentationRelationshipsPartitioningEncapsulationAbstractionLess Distinctions, More Commonality!separate the essential from full detailselective, simplified viewRepresentationRelationships
2022-01-23 19:14:57
169
原创 COMP0004-Notes(1): Java
Contents1. Java the languageJava SE & Java JDKJVMClassesObjects & ReferencesClasses on HeapInstance VariablesMethodsData typesPrimitive & Object Data TypesType Inference & CastingBoxing(Auto-) & Unboxing2. JavaDocModules and Packages1.
2022-01-21 04:31:59
571
原创 基于一道加拿大高中组合数学题解法的python代码验证---CALENDAR
Calculate the number of 'words' that can be formed from all the letters inthe word CALENDAR if C and A must be together, but N and D are not together.用单词CALENDAR的字母重新组合成不同的单词,使得每个单词中的字母C与至少一个A在一起,...
2020-03-02 02:17:23
2301
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人